From 823752496e2a4cdb6a1fb36227cd15b8b7135336 Mon Sep 17 00:00:00 2001 From: 刘磊 <1161824510@qq.com> Date: 星期六, 19 四月 2025 15:22:04 +0800 Subject: [PATCH] 提交代码 --- 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Common/AGVInterface/Requset/RequsetContext/cancelTask.cs | 36 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_IRepository/ISys_UserRepository.cs | 16 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Repository/Sys_TenantRepository.cs | 18 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_BusinessServices/Dt_AreaInfoService.cs | 18 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_IStorageOutOrderService/OutboundOrder/IDt_OutOrderTransferDetailService.cs | 5 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicRepository/BasicInfo/Dt_TraintypeRepository.cs | 28 项目代码/WMS/WIDESEA_WMSServer/LogLibrary/Log/LogUtil.cs | 57 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Core/BaseModels/Permissions.cs | 27 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_DTO/Location/LocationChangeRecordDto.cs | 35 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_IRepository/ISys_ConfigRepository.cs | 15 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/WCS/WCSService.cs | 34 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_IBusinessServices/IDt_UnitInfoService.cs | 14 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_DTO/Basic/UpdateStatusDto.cs | 21 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Common/StatusChangeType/StatusChangeTypeEnum.cs | 25 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Core/BaseServices/ServiceBase.cs | 752 + 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_IStorageTaskService/Task/IDt_TaskService.cs | 174 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicRepository/Stock/StockInfoRepository.cs | 9 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Basic/Dt_MaterielInfo.cs | 95 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Check/ToCheckController.cs | 44 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Properties/launchSettings.json | 31 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Core/Helper/AutoMapperHelper.cs | 23 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_IStorageOutOrderRepository/OutboundOrder/IDt_OutOrderTransferRepository.cs | 5 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicRepository/CacheInfo/Dt_CacheInfo_htyRepository.cs | 9 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Core/Helper/SqlSugarHelper.cs | 40 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_DTO/System/MenuDTO.cs | 14 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_StorageOutOrderServices/OutboundOrder/Dt_OutOrderTransferDetailService.cs | 11 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_IRepository/ISys_MenuRepository.cs | 27 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_IStorageOutOrderService/OutboundOrder/IDt_OutOrderAndStockService.cs | 27 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_IStorageTaskService/GlobalUsing.cs | 3 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/WCS/WCSController.cs | 24 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Partial/Dt_TaskService.cs | 254 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Core/Extensions/InitializationHostServiceSetup.cs | 28 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/Stock/Dt_WheelsStockService.cs | 123 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Core/Filter/ExporterHeaderFilter.cs | 23 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/MCS/Partial/RequestChangeLocation.cs | 299 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_StorageOutOrderRepository/OutboundOrder/Dt_OutOrderTransferDetailRepository.cs | 8 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_IServices/ISys_UserService.cs | 24 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/GZ_ZC/Dt_InWheels_mes.cs | 156 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/Check/Dt_CheckResultService.cs | 63 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Core/DB/MainDb.cs | 29 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Core/Const/TenantConst.cs | 13 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/CacheInfo/Dt_CacheInfoService.cs | 82 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_BusinessServices/Dt_TypeMappingService.cs | 18 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/GZ_ZC/DistributeWheels/SelectionWheels.cs | 55 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicRepository/Boxing/Dt_InWheels_mesRepository.cs | 9 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/System/Sys_DictionaryList.cs | 57 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_IBusinessesRepository/IDt_TaskExecuteDetailRepository.cs | 14 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_BusinessServices/Dt_WareAreaInfoService.cs | 18 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/ToCheckEquip/ToCheckService.cs | 45 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/GlobalUsing.cs | 16 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/ZY/Partial/ZY_GetCLInfo.cs | 89 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Common/HttpClient/HttpsClient.cs | 296 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/ZY/Partial/ReportToSCE.cs | 55 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicRepository/Stock/IStockInfoRepository.cs | 6 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Dt_WareAreaInfoController.cs | 20 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/APP/ToAPPController.cs | 44 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Core/Middlewares/JwtTokenAuthMiddleware.cs | 94 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/Boxing/BoxingInfoService.cs | 51 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/Stock/Dt_WheelsStock_OldService.cs | 66 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicRepository/BasicInfo/IDt_needBarcodeRepository.cs | 32 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/appsettings.Development.json | 8 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Core/AOP/LogAOP.cs | 328 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_DTO/MCS/RequsetCellInfo.cs | 24 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicRepository/Boxing/BoxingInfoDetailRepository.cs | 9 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Basic/Dt_Strategy.cs | 126 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/appsettings.json | 41 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_IStoragIntegrationServices/MCS/IMCSService.cs | 20 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Core/Extensions/HttpContextSetup.cs | 30 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Core/BaseModels/PageGridData.cs | 26 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Common/ZY/CZInfo_ZY.cs | 234 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_IServices/ISys_ConfigService.cs | 37 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_IBusinessServices/IDt_MaterielAttributeService.cs | 13 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Core/Extensions/DbSetup.cs | 24 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_DTO/MCS/WorkState.cs | 31 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_BusinessesRepository/Dt_WareAreaInfoRepository.cs | 13 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_IBusinessesRepository/IDt_StrategyRepository.cs | 14 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_IStoragIntegrationServices/ZY/IToZYService.cs | 23 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/OutboundOrder/Dt_OutOrderAndStock.cs | 130 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Basic/Dt_RoadWayInfo.cs | 90 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_IStorageOutOrderRepository/OutboundOrder/IDt_OutOrderTransferDetailRepository.cs | 5 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Core/Helper/FileHelper.cs | 428 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/Location/LocationInfoService.cs | 516 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/OutboundOrder/Dt_OutOrderSorting.cs | 149 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicRepository/BasicInfo/IDt_SelectionStandardsRepository.cs | 32 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/System/Sys_Test.cs | 31 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_IRepository/ISys_DictionaryRepository.cs | 15 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_IStoragIntegrationServices/新文件夹/IToCheckService.cs | 15 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Basic/Dt_TypeMapping.cs | 84 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/System/Sys_ConfigController.cs | 18 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_IStorageTaskRepository/Task/IDt_TaskRepository.cs | 32 项目代码/WMS/WIDESEA_WMSServer/LogLibrary/Log/Level.cs | 16 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Common/StationManager/StationManager.cs | 62 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicRepository/Location/LocationStatusChangeRecordRepository.cs | 92 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Core/Seed/DBSeed.cs | 320 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Core/Const/ErrorMsgConst.cs | 15 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Core/Helper/ConsoleHelper.cs | 57 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Core/Extensions/AutofacModuleRegister.cs | 78 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_IStorageOutOrderRepository/OutboundOrder/IDt_OutOrderProductionDetailRepository.cs | 5 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_IServices/ISys_CompanyRegistrationService.cs | 12 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/Boxing/Dt_InWheels_mesService.cs | 211 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Core/BaseModels/PageDataOptions.cs | 35 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicRepository/GlobalUsing.cs | 3 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Core/Utilities/EntityProperties.cs | 311 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/ToAPP/Partial/SaveCZInfo.cs | 457 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicRepository/Stock/Dt_WheelsStock_OldRepository.cs | 9 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicRepository/BasicInfo/Dt_needBarcodeRepository.cs | 28 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Core/Extensions/JobSetup.cs | 23 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/WCS/Partial/CallPalletCode.cs | 59 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicService/Check/IDt_CheckResultService.cs | 6 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Core/Caches/SqlSugarCacheService.cs | 69 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Services/Sys_ConfigService.cs | 43 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/GlobalUsing.cs | 17 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicService/Boxing/IBoxingInfoService.cs | 13 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/BasicModel/DtStockInfo.cs | 147 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/System/Sys_Department.cs | 57 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_IStorageTaskRepository/Task/ITaskExecuteDetailRepository.cs | 13 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Core/Extensions/ApplicationSetup.cs | 28 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Common/ZY/Basic_ZY.cs | 25 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_StorageOutOrderServices/OutboundOrder/Dt_OutOrderTransferService.cs | 11 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Basic/BoxingInfoController.cs | 17 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_StorageOutOrderRepository/OutboundOrder/Dt_OutOrderProductionDetailRepository.cs | 8 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Core/BaseController/ApiBaseController.cs | 111 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_BusinessServices/Dt_RoadWayInfoService.cs | 18 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicRepository/Check/IDt_CacheInfo_htyRepository.cs | 6 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_BusinessesRepository/Dt_TypeMappingRepository.cs | 13 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/Stock/Dt_WheelsStock_htyService.cs | 17 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicRepository/Location/LocationInfoRepository.cs | 9 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/BasicInfo/Partial/Method.cs | 24 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_StorageOutOrderRepository/OutboundOrder/Dt_OutOrderAndStockRepository.cs | 53 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_BusinessServices/Dt_TaskExecuteDetailService.cs | 18 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Core/Helper/MethodInfoExtensions.cs | 22 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Common/ZY/clinfo.cs | 40 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_StorageOutOrderServices/OutboundOrder/Dt_OutOrderProductionDetailService.cs | 21 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Core/Authorization/AuthorizationResponse.cs | 46 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Core/BaseRepository/RepositoryBase.cs | 899 + 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Filter/AutoMapperConfig.cs | 18 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/CacheInfo/Dt_CacheInfoController.cs | 26 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_IServices/ISys_RoleService.cs | 23 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_IStorageOutOrderService/OutboundOrder/IDt_OutOrderProductionService.cs | 11 项目代码/WMS/WIDESEA_WMSServer/LogLibrary/Log/Log.cs | 755 + 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/Boxing/Dt_InWheels_mes_htyService.cs | 26 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicService/Stock/IDt_WheelsStock_htyService.cs | 6 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Services/Sys_CompanyRegistrationService.cs | 161 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Repository/Sys_RoleRepository.cs | 18 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Core/BaseRepository/UnitOfWorks/UnitOfWorkManage.cs | 215 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_StorageOutOrderServices/OutboundOrder/Dt_OutOrderAndStockService.cs | 44 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/wwwroot/css/style.css | 132 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/OutboundOrder/Dt_OutOrderDetail.cs | 109 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Core/Authorization/JwtHelper.cs | 118 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Core/Middlewares/ExceptionHandlerMiddleware.cs | 59 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_IStorageOutOrderRepository/OutboundOrder/IDt_OutOrderAndStockRepository.cs | 27 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/Boxing/Dt_CZInfo_mes_htyService.cs | 200 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/System/Sys_MenuController.cs | 50 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Basic/LocationStatusChangeRecordController.cs | 10 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Stock/Dt_WheelsStockController.cs | 13 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Core/Extensions/IpPolicyRateLimitSetup.cs | 43 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/ToAPP/Partial/SaveCLinfo.cs | 144 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/ZY/Partial/getZDPInfo.cs | 81 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_DTO/MCS/NotifyFinishTest.cs | 32 项目代码/WMS/WIDESEA_WMSServer/LogLibrary/Log/ILog.cs | 89 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_IBusinessServices/IDt_TypeMappingService.cs | 14 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Common/SysConst/TaskConst.cs | 13 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Core/Middlewares/IpLimitMiddleware.cs | 41 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_IStorageOutOrderService/GlobalUsing.cs | 3 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/OutboundOrder/Dt_OutOrderTransferDetail.cs | 53 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Core/BaseServices/ServiceFunFilter.cs | 234 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Basic/Dt_MaterielAttribute.cs | 116 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Core/Helper/ExportHelper.cs | 106 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicService/Boxing/IDt_CZInfo_mesService.cs | 8 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/BasicInfo/Dt_StationManager.cs | 107 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/System/Sys_TenantController.cs | 19 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Core/Filter/ApiAuthorizeFilter.cs | 80 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_StorageOutOrderServices/GlobalUsing.cs | 14 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Common/AGVInterface/Respon/AGVResponBase.cs | 31 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicRepository/Check/IDt_CheckResultRepository.cs | 6 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicRepository/Boxing/Dt_CZInfo_mesRepository.cs | 9 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_StorageOutOrderRepository/OutboundOrder/Dt_OutOrderTransferRepository.cs | 8 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Common/ZY/ZDPInfo_ZY.cs | 163 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_BusinessesRepository/Dt_StrategyRepository.cs | 13 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskRepository/Task/TaskExecuteDetailRepository.cs | 29 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Basic/StockInfoDetailController.cs | 12 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/ToCheckEquip/Partial/GetCheckInfo.cs | 118 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/GZ_ZC/Dt_SelectionStandards.cs | 64 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/BasicModel/DtStockInfoDetail_Hty.cs | 74 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/BasicInfo/dt_needBarcode.cs | 62 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Core/Enums/EnumHelper.cs | 111 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicRepository/Location/ILocationInfoRepository.cs | 5 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_DTO/WCS/dt_needBarcode.cs | 59 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/wwwroot/js/anime.min.js | 33 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_BusinessesRepository/Dt_MaterielAttributeRepository.cs | 13 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Core/DB/RepositorySetting.cs | 53 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/index.html | 124 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicRepository/Stock/Dt_WheelsStockRepository.cs | 9 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicService/Location/ILocationInfoService.cs | 19 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicService/Boxing/IBoxingInfoDetailService.cs | 5 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Core/Middlewares/MiddlewareHelpers.cs | 42 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_BusinessesRepository/Dt_AreaInfoRepository.cs | 16 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/BasicInfo/Dt_SelectionStandardsController.cs | 22 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Core/BaseModels/SaveModel.cs | 21 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_IStoragIntegrationServices/ToCheckEquip/IToCheckService.cs | 17 项目代码/WMS/WIDESEA_WMSServer/.editorconfig | 4 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/OutboundOrder/Dt_OutOrderDetail_Hty.cs | 130 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicService/Stock/IDt_WheelsStock_OldService.cs | 7 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/OutboundOrder/Dt_OutOrderTransfer.cs | 60 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Core/Helper/SecurityEncDecryptHelper.cs | 89 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Services/Sys_TenantService.cs | 80 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicRepository/Boxing/IDt_CZInfo_mesRepository.cs | 8 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Common/SysConst/operationType.cs | 13 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Core/Core/IConfigurableOptions.cs | 12 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_IStorageOutOrderRepository/OutboundOrder/IDt_OutOrderRepository.cs | 15 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/wwwroot/WIDESEA_DB.DBSeed.Json/Sys_Menu.tsv | 146 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Core/Extensions/MemoryCacheSetup.cs | 27 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/MCS/Partial/RequsetCellInfo.cs | 67 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/OutboundOrder/Dt_OutOrderProductionDetailController.cs | 17 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/GZ_ZC/Dt_CacheInfo.cs | 58 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicRepository/Boxing/Dt_CZInfo_mes_htyRepository.cs | 9 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskRepository/GlobalUsing.cs | 3 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Filter/AutoMapperSetup.cs | 16 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Core/Extensions/SqlsugarSetup.cs | 143 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Common/LevelChange/CheckTaskChangeHelper.cs | 34 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/BasicInfo/Dt_StationManagerController.cs | 22 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/System/Sys_TestController.cs | 19 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_StorageOutOrderRepository/OutboundOrder/Dt_OutOrderDtailRepository.cs | 8 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/OutboundOrder/Dt_OutOrderController.cs | 49 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Core/Middlewares/SwaggerAuthMiddleware.cs | 80 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicRepository/Stock/IDt_WheelsStockRepository.cs | 6 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicService/Stock/IStockInfoDetailService.cs | 5 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicRepository/Boxing/IDt_CZInfo_mes_htyRepository.cs | 8 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_DTO/System/RegistrationDTO.cs | 13 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_DTO/System/UserPermissions.cs | 17 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/GZ_ZC/Dt_CacheInfo_hty.cs | 29 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicRepository/Boxing/IDt_InWheels_mes_htyRepository.cs | 8 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_StorageOutOrderRepository/OutboundOrder/Dt_OutOrderProductionRepository.cs | 18 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Core/LogHelper/Logger.cs | 124 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Dt_UnitInfoController.cs | 20 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Core/Helper/UtilConvert.cs | 970 + 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_IStorageTaskService/Task/IDt_Task_HtyService.cs | 11 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicRepository/Boxing/BoxingInfoRepository.cs | 9 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Common/XmlTool/XMLSerializationTool.cs | 137 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_DTO/WMS/OutBoundMateriel.cs | 15 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_StorageOutOrderRepository/OutboundOrder/Dt_OutOrderRepository.cs | 30 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/GZ_ZC/Dt_WheelsStock_hty.cs | 27 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Services/Sys_TestService.cs | 36 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Core/Utilities/LambdaExtensions.cs | 183 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_IBusinessesRepository/IDt_MaterielInfoRepository.cs | 14 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/BasicInfo/dt_needBarcodeController.cs | 22 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Basic/Dt_Task.cs | 197 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Core/Const/SqlDbTypeName.cs | 29 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/OutboundOrder/Dt_OutOrderTransferDetail_Hty.cs | 75 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/Boxing/BoxingInfoDetailService.cs | 8 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/OutboundOrder/Dt_OutOrderProductionDetail_Hty.cs | 75 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/System/Sys_RoleAuth.cs | 48 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_BusinessServices/Dt_StrategyService.cs | 18 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Core/Caches/Caching.cs | 351 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/MCS/Partial/NotifyFinishTest.cs | 141 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/System/Sys_RegistrationController.cs | 26 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/BasicInfo/Dt_SelectionStandardsService.cs | 66 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/WCS/Partial/ManualOutboundTask.cs | 37 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/OutboundOrder/Dt_OutOrderAndStockController.cs | 17 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Core/IDependency.cs | 12 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_IStorageOutOrderService/OutboundOrder/IDt_OutOrderDtailService.cs | 5 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Core/Extensions/SwaggerSetup.cs | 134 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_IRepository/ISys_TenantRepository.cs | 14 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_IServices/ISys_TestService.cs | 16 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_IRepository/ISys_RoleRepository.cs | 14 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskRepository/Task/Dt_TaskRepository.cs | 73 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_IRepository/ISys_TestRepository.cs | 14 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Basic/Dt_CZInfo_mes_htyController.cs | 11 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Services/Sys_RoleService.cs | 217 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Core/Filter/GlobalExceptionsFilter.cs | 93 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/ToAPP/ToAPPService.cs | 45 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs | 956 + 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Core/BaseRepository/UnitOfWorks/UnitOfWork.cs | 55 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicRepository/Boxing/Dt_InWheels_mes_htyRepository.cs | 9 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_BusinessServices/Dt_MaterielAttributeService.cs | 18 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Core/Middlewares/SwaggerMiddleware.cs | 59 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/ZY/Partial/getCZInfo.cs | 77 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Core/Filter/IFixedTokenFilter.cs | 57 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/GZ_ZC/Dt_CZInfo_mes.cs | 243 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Core/Utilities/VierificationCode.cs | 123 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/ToCheckEquip/Partial/UploadCheckResult.cs | 86 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Core/LogHelper/LogLock.cs | 93 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_DTO/WCS/Dt_DeviceInfo.cs | 104 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Core/DB/Models/BaseEntity.cs | 100 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Core/Middlewares/ApiLogMiddleware.cs | 113 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_IBusinessServices/IDt_StrategyService.cs | 14 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/OutboundOrder/Dt_OutOrderProduction.cs | 53 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/System/Sys_RoleController.cs | 64 项目代码/WMS/WIDESEA_WMSServer/LogLibrary/Log/FileUtil.cs | 39 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/Stock/StockInfoService.cs | 114 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/TaskExecuteDetailService.cs | 13 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/AGV/Partial/genAgvSchedulingTask.cs | 66 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicService/Boxing/IDt_InWheels_mesService.cs | 8 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Dt_MaterielAttributeController.cs | 20 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_DTO/WMS/WMSTaskDTO.cs | 87 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/OutboundOrder/Dt_OutOrder.cs | 67 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Core/BaseModels/WebResponseContent.cs | 55 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/OutboundOrder/Dt_OutOrderProductionDetail.cs | 53 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/OutboundOrder/Dt_OutOrderDetailController.cs | 18 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_StorageOutOrderServices/OutboundOrder/Dt_OutOrderService.cs | 659 + 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Repository/Sys_TestRepository.cs | 18 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicRepository/Boxing/IBoxingInfoDetailRepository.cs | 6 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Common/AGVTask/agvTask.cs | 128 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/OutboundOrder/Dt_OutOrderTransfer_Hty.cs | 81 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Core/Helper/ObjectExtension.cs | 51 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Repository/Sys_DictionaryRepository.cs | 75 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_StorageOutOrderServices/OutboundOrder/Dt_OutOrderProductionService.cs | 21 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/OutboundOrder/Dt_OutOrderTransferController.cs | 17 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicService/Stock/IDt_WheelsStockService.cs | 7 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicRepository/BasicInfo/IDt_TraintypeRepository.cs | 32 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_IRepository/ISys_CompanyRegistrationRepository.cs | 14 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer.sln | 474 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicService/Boxing/IDt_InWheels_mes_htyService.cs | 8 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/System/Sys_ExteriorInterface.cs | 68 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicRepository/Stock/Dt_WheelsStock_htyRepository.cs | 9 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/OutboundOrder/Dt_OutOrder_Hty.cs | 88 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/System/Sys_Config.cs | 53 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/TaskExecuteDetailController.cs | 20 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicRepository/BasicInfo/IDt_StationManagerRepository.cs | 31 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Core/Const/HtmlElementType.cs | 32 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/System/Sys_User.cs | 151 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/OutboundOrder/Dt_OutOrderProduction_Hty.cs | 74 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Common/ZY/CLInfo_ZY.cs | 139 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicRepository/Stock/IDt_WheelsStock_htyRepository.cs | 6 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/GZ_ZC/Dt_WheelsStock.cs | 216 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Dt_StrategyController.cs | 20 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_DTO/System/ActionDTO.cs | 16 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/System/Sys_Dictionary.cs | 95 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Basic/LocationInfoController.cs | 39 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Services/Sys_UserService.cs | 216 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/ToAPP/Partial/SaveZDPInfo.cs | 131 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/BasicModel/DtStockInfoDetail.cs | 79 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/wwwroot/WIDESEA_DB.DBSeed.Json/Sys_Tenant.tsv | 3 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Core/Extensions/AllOptionRegister.cs | 24 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Check/Dt_CheckResultController.cs | 26 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Core/Extensions/MiniProfilerSetup.cs | 32 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/System/Sys_Tenant.cs | 57 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_IBusinessServices/IDt_WareAreaInfoService.cs | 13 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/System/RoleNodes.cs | 15 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_IStorageTaskService/Task/ITaskExecuteDetailService.cs | 6 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Basic/Dt_WareAreaInfo.cs | 60 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Common/AGVInterface/Requset/RequsetContext/continueTask.cs | 61 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/wwwroot/swg-login.html | 130 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Core/Tenants/TenantUtil.cs | 127 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/System/Sys_DictionaryController.cs | 19 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_IBusinessesRepository/IDt_UnitInfoRepository.cs | 14 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_IServices/ISys_TenantService.cs | 16 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/System/RoleAuthor.cs | 14 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Core/Const/TenantStatus.cs | 14 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_IBusinessesRepository/IDt_WareAreaInfoRepository.cs | 14 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Core/BaseRepository/UnitOfWorks/IUnitOfWorkManage.cs | 26 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/MCS/MCSController.cs | 66 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Common/LevelChange/LevelChangeHelper.cs | 58 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_IBusinessServices/IDt_AreaInfoService.cs | 14 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_IBusinessServices/IDt_TaskExecuteDetailService.cs | 14 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicService/BasicInfo/IDt_StationManagerService.cs | 30 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicService/Location/ILocationStatusChangeRecordService.cs | 5 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/CacheInfo/Dt_CacheInfo_htyService.cs | 16 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_IStorageOutOrderService/OutboundOrder/IDt_OutOrderProductionDetailService.cs | 11 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Core/Core/InternalApp.cs | 47 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Core/Helper/RuntimeExtension.cs | 89 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Core/Core/ConfigurableOptions.cs | 66 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Filter/CustomProfile.cs | 26 项目代码/WMS/WIDESEA_WMSServer/LogLibrary/Log/ILogFactory.cs | 7 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/GZ_ZC/Dt_InWheels_mes_hty.cs | 27 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/BasicInfo/Dt_TraintypeService.cs | 14 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Common/AGVInterface/Requset/AGVRequsetBase.cs | 19 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_IStorageOutOrderService/OutboundOrder/IDt_OutOrderTransferService.cs | 5 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicService/CacheInfo/IDt_CacheInfoService.cs | 13 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/GlobalUsing.cs | 20 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Core/HostedService/SeedDataHostedService.cs | 72 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/BasicModel/DtBoxingInfoDetail.cs | 82 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Core/Const/AppSecret.cs | 29 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_IStorageOutOrderService/OutboundOrder/IDt_OutOrderAndStock_HtyService.cs | 11 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/MCS/MCSService.cs | 37 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicRepository/GlobalUsing.cs | 2 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_BusinessesRepository/Dt_TaskExecuteDetailRepository.cs | 13 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Repository/Sys_UserRepository.cs | 26 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Task_HtyController.cs | 26 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Basic/Dt_CZInfo_mesController.cs | 11 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_IBusinessServices/IDt_MaterielInfoService.cs | 14 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicService/BasicInfo/IDt_TraintypeService.cs | 27 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_IStoragIntegrationServices/ToAPP/IToAPPService.cs | 17 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/System/Sys_CompanyRegistration.cs | 62 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_IStorageOutOrderService/OutboundOrder/IDt_OutOrderService.cs | 39 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicRepository/Check/Dt_CheckResultRepository.cs | 9 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_DTO/RoadWayDTO.cs | 34 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/OutboundOrder/Dt_OutOrderAndStock_HtyController.cs | 17 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Basic/Dt_InWheels_mes_htyController.cs | 11 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/wwwroot/WIDESEA_DB.DBSeed.Json/Sys_User.tsv | 26 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Repository/Sys_MenuRepository.cs | 207 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Core/Helper/AppSettings.cs | 89 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/System/Sys_Menu.cs | 85 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_IStorageOutOrderRepository/GlobalUsing.cs | 2 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_IStorageOutOrderRepository/OutboundOrder/IDt_OutOrderProductionRepository.cs | 11 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/OutboundOrder/Dt_OutOrderTransferDetailController.cs | 17 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Basic/StockInfoController.cs | 12 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/ZY/ToZYController.cs | 57 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Repository/Sys_RoleAuthRepository.cs | 18 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicRepository/BasicInfo/Dt_StationManagerRepository.cs | 28 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicRepository/Location/ILocationStatusChangeRecordRepository.cs | 17 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Core/BaseServices/IService.cs | 121 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Filter/AutofacPropertityModuleReg.cs | 17 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Core/AOP/SqlSugarAop.cs | 72 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_BusinessesRepository/Dt_MaterielInfoRepository.cs | 13 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Core/Tenants/ITenantEntity.cs | 21 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicService/Stock/IStockInfoService.cs | 5 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Core/Const/ConfigConst.cs | 100 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_IStorageOutOrderRepository/OutboundOrder/IDt_OutOrderAndStock_HtyRepository.cs | 11 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_IServices/ISys_MenuService.cs | 29 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_IRepository/ISys_RoleAuthRepository.cs | 14 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/BasicModel/DtLocationStatusChangeRecord.cs | 74 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskRepository/Task/Dt_Task_HtyRepository.cs | 13 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Core/Helper/HttpHelper.cs | 112 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Common/AGVInterface/Requset/RequsetContext/genAgvSchedulingTask.cs | 128 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicRepository/Boxing/IBoxingInfoRepository.cs | 6 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/BasicModel/DtStockInfo_Hty.cs | 141 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/Stock/StockInfoDetailService.cs | 8 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicService/BasicInfo/IDt_SelectionStandardsService.cs | 27 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_IBusinessesRepository/IDt_TypeMappingRepository.cs | 14 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Dt_RoadWayInfoController.cs | 20 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Common/DetailMessage/TaskDescription.cs | 31 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_StorageOutOrderRepository/GlobalUsing.cs | 3 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/AGV/ToAGVService.cs | 45 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_DTO/MCS/RequestReMove.cs | 32 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/BasicInfo/Dt_TraintypeController.cs | 22 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Core/Seed/FrameSeed.cs | 582 + 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Core/Authorization/AuthorizationSetup.cs | 67 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_StorageOutOrderServices/OutboundOrder/Dt_OutOrderDtailService.cs | 11 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Core/BaseRepository/IRepository.cs | 441 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/BasicModel/DtLocationInfo.cs | 86 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_IStorageTaskRepository/GlobalUsing.cs | 2 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Basic/Dt_TaskExecuteDetail.cs | 57 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_BusinessServices/Dt_MaterielInfoService.cs | 18 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Core/HttpContextUser/AspNetUser.cs | 199 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Basic/Dt_UnitInfo.cs | 111 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicService/GlobalUsing.cs | 3 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/TaskController.cs | 125 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicService/Boxing/IDt_CZInfo_mes_htyService.cs | 8 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Common/AGVInterface/Requset/RequsetContext/bindCtnrAndBin.cs | 51 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Core/Caches/ICaching.cs | 59 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Core/Enums/LinqExpressionType.cs | 21 项目代码/WMS/WIDESEA_WMSServer/LogLibrary/Properties/AssemblyInfo.cs | 36 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Repository/Sys_CompanyRegistrationRepository.cs | 12 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Core/Extensions/CorsSetup.cs | 56 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_IStorageTaskRepository/Task/IDt_Task_HtyRepository.cs | 6 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicRepository/Stock/IDt_WheelsStock_OldRepository.cs | 6 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Basic/Dt_AreaInfo.cs | 103 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_StorageOutOrderServices/OutboundOrder/Dt_OutOrderAndStock_HtyService.cs | 22 项目代码/WMS/WIDESEA_WMSServer/LogLibrary/Log/LogFactory.cs | 11 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicService/CacheInfo/IDt_CacheInfo_htyService.cs | 8 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Core/DB/BaseDBConfig.cs | 121 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_IStoragIntegrationServices/WCS/IWCSService.cs | 14 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_IStorageOutOrderRepository/OutboundOrder/IDt_OutOrderDtailRepository.cs | 5 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Dt_AreaInfoController.cs | 20 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/ZY/ToZYService.cs | 43 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/AGV/Partial/UntieStation.cs | 59 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/Boxing/Dt_CZInfo_mesService.cs | 202 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/MCS/Partial/ModifyAccessStatus.cs | 64 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Core/Const/CacheConst.cs | 94 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/BasicInfo/Dt_needBarcodeService.cs | 14 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Core/HttpContextUser/IUser.cs | 56 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_DTO/MCS/NotityInFinish.cs | 27 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_IBusinessesRepository/IDt_AreaInfoRepository.cs | 14 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicRepository/Stock/StockInfoDetailRepository.cs | 9 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_IBusinessServices/Dt_RoadWayInfoService.cs | 14 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicService/BasicInfo/IDt_needBarcodeService.cs | 28 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/System/Sys_Log.cs | 86 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Common/AGVInterface/Requset/RequsetContext/blockStgBin.cs | 32 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Services/Sys_MenuService.cs | 207 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_BusinessesRepository/Dt_UnitInfoRepository.cs | 13 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Dt_MaterielInfoController.cs | 19 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicRepository/Boxing/IDt_InWheels_mesRepository.cs | 8 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Core/Filter/UseServiceDIAttribute.cs | 38 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_DTO/Basic/RequestTaskDto.cs | 41 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/BasicModel/DtBoxingInfo.cs | 64 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Repository/Sys_ConfigRepository.cs | 21 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicRepository/Stock/IStockInfoDetailRepository.cs | 14 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Basic/Dt_Task_Hty.cs | 31 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Common/CheckEquip/CheckInfo.cs | 59 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Common/CheckEquip/CheckResult.cs | 112 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_StorageOutOrderRepository/OutboundOrder/Dt_OutOrderAndStock_HtyRepository.cs | 21 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/GZ_ZC/OldWheelsStock/Dt_WheelsStock_Old.cs | 240 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Core/Enums/ManageEnum.cs | 623 + 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/System/Sys_Role.cs | 54 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Services/Sys_DictionaryService.cs | 50 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Stock/Dt_WheelsStock_OldController.cs | 26 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Core/Helper/HttpContextHelper.cs | 36 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_IBusinessesRepository/IDt_MaterielAttributeRepository.cs | 14 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Core/Seed/DBContext.cs | 217 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_IBusinessesRepository/IDt_RoadWayInfoRepository.cs | 14 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_Task_HtyService.cs | 25 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Core/App.cs | 202 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/BasicInfo/Dt_Traintype.cs | 46 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicRepository/BasicInfo/Dt_SelectionStandardsRepository.cs | 28 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/GZ_ZC/Dt_CheckResult.cs | 184 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/OutboundOrder/Dt_OutOrderProductionController.cs | 17 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Core/Tenants/MultiTenantAttribute.cs | 56 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_BusinessServices/Dt_UnitInfoService.cs | 18 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_IServices/ISys_DictionaryService.cs | 15 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Model/LoginInfo.cs | 15 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/System/Sys_UserController.cs | 68 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/GZ_ZC/Dt_CZInfo_mes_hty.cs | 28 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicRepository/CacheInfo/Dt_CacheInfoRepository.cs | 9 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_BusinessesRepository/Dt_RoadWayInfoRepository.cs | 13 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Basic/Dt_InWheels_mesController.cs | 11 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/BasicInfo/Dt_StationManagerService.cs | 16 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/AGV/Partial/agvCallback.cs | 55 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/OutboundOrder/Dt_OutOrderAndStock_Hty.cs | 145 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/Location/LocationStatusChangeRecordService.cs | 8 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Stock/Dt_WheelsStock_htyController.cs | 13 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicRepository/CacheInfo/IDt_CacheInfoRepository.cs | 6 512 files changed, 33,870 insertions(+), 0 deletions(-) diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/.editorconfig" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/.editorconfig" new file mode 100644 index 0000000..54621aa --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/.editorconfig" @@ -0,0 +1,4 @@ +锘縖*.cs] + +# CS8618: 鍦ㄩ��鍑烘瀯閫犲嚱鏁版椂锛屼笉鍙负 null 鐨勫瓧娈靛繀椤诲寘鍚潪 null 鍊笺�傝鑰冭檻娣诲姞 "required" 淇グ绗︽垨澹版槑涓哄彲涓� null銆� +dotnet_diagnostic.CS8618.severity = silent diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/LogLibrary/Log/FileUtil.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/LogLibrary/Log/FileUtil.cs" new file mode 100644 index 0000000..2aaeea4 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/LogLibrary/Log/FileUtil.cs" @@ -0,0 +1,39 @@ +锘縰sing System; +using System.IO; +using System.Threading; + +namespace LogLibrary.Log +{ + public static class FileUtil + { + + /// <summary> + /// 杩藉姞鍐呭鍒版寚瀹氭枃浠朵腑 + /// </summary> + /// <param name="filePath"></param> + /// <param name="content"></param> + public static void WriteAppend(string filePath, string content) + { + WriteAppend(filePath, new string[] { content }); + } + + public static void WriteAppend(string filePath, string[] contents) + { + using (FileStream fs = new(filePath, FileMode.OpenOrCreate, FileAccess.Write, FileShare.ReadWrite)) + { + fs.Seek(fs.Length, SeekOrigin.Current); + + string content = string.Join(Environment.NewLine, contents) + Environment.NewLine; + + //byte[] data = System.Text.Encoding.GetEncoding("GB2312").GetBytes(content); + byte[] data = System.Text.Encoding.Default.GetBytes(content); + + + fs.Write(data, 0, data.Length); + + fs.Close(); + fs.Dispose(); + } + } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/LogLibrary/Log/ILog.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/LogLibrary/Log/ILog.cs" new file mode 100644 index 0000000..11c5c38 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/LogLibrary/Log/ILog.cs" @@ -0,0 +1,89 @@ +锘縰sing System; + +namespace LogLibrary.Log +{ + public unsafe interface ILog + { + bool* IsCryto { set; } + bool IsDebugEnabled { get; } + + bool IsErrorEnabled { get; } + + bool IsFatalEnabled { get; } + + bool IsInfoEnabled { get; } + + bool IsWarnEnabled { get; } + + void Debug(bool isWriteFile, object message); + + void Debug(bool isWriteFile, object message, Exception exception); + + void DebugFormat(bool isWriteFile, string format, object arg0); + + void DebugFormat(bool isWriteFile, string format, params object[] args); + + void DebugFormat(bool isWriteFile, IFormatProvider provider, string format, params object[] args); + + void DebugFormat(bool isWriteFile, string format, object arg0, object arg1); + + void DebugFormat(bool isWriteFile, string format, object arg0, object arg1, object arg2); + + void Error(bool isWriteFile, object message); + + void Error(bool isWriteFile, object message, Exception exception); + + void ErrorFormat(bool isWriteFile, string format, object arg0); + + void ErrorFormat(bool isWriteFile, string format, params object[] args); + + void ErrorFormat(bool isWriteFile, IFormatProvider provider, string format, params object[] args); + + void ErrorFormat(bool isWriteFile, string format, object arg0, object arg1); + + void ErrorFormat(bool isWriteFile, string format, object arg0, object arg1, object arg2); + + void Fatal(bool isWriteFile, object message); + + void Fatal(bool isWriteFile, object message, Exception exception); + + void FatalFormat(bool isWriteFile, string format, object arg0); + + void FatalFormat(bool isWriteFile, string format, params object[] args); + + void FatalFormat(bool isWriteFile, IFormatProvider provider, string format, params object[] args); + + void FatalFormat(bool isWriteFile, string format, object arg0, object arg1); + + void FatalFormat(bool isWriteFile, string format, object arg0, object arg1, object arg2); + + void Info(bool isWriteFile, object message); + + void Info(bool isWriteFile, object message, Exception exception); + + //void InfoFormat(bool isWriteFile, string format, object arg0); + + //void InfoFormat(bool isWriteFile, string format, params object[] args); + + //void InfoFormat(bool isWriteFile, IFormatProvider provider, string format, params object[] args); + + //void InfoFormat(bool isWriteFile, string format, object arg0, object arg1); + + void InfoFormat(bool isWriteFile, object arg0, object arg1, object arg2); + + void Warn(bool isWriteFile, object message); + + void Warn(bool isWriteFile, object message, Exception exception); + + void WarnFormat(bool isWriteFile, string format, object arg0); + + void WarnFormat(bool isWriteFile, string format, params object[] args); + + void WarnFormat(bool isWriteFile, IFormatProvider provider, string format, params object[] args); + + void WarnFormat(bool isWriteFile, string format, object arg0, object arg1); + + void WarnFormat(bool isWriteFile, string format, object arg0, object arg1, object arg2); + + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/LogLibrary/Log/ILogFactory.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/LogLibrary/Log/ILogFactory.cs" new file mode 100644 index 0000000..520235a --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/LogLibrary/Log/ILogFactory.cs" @@ -0,0 +1,7 @@ +锘縩amespace LogLibrary.Log +{ + public interface ILogFactory + { + ILog GetLog(string name); + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/LogLibrary/Log/Level.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/LogLibrary/Log/Level.cs" new file mode 100644 index 0000000..0cfd286 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/LogLibrary/Log/Level.cs" @@ -0,0 +1,16 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace LogLibrary.Log +{ + public enum Level : int + { + Debug, + Info, + Warning, + Error + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/LogLibrary/Log/Log.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/LogLibrary/Log/Log.cs" new file mode 100644 index 0000000..7c81819 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/LogLibrary/Log/Log.cs" @@ -0,0 +1,755 @@ +锘縰sing System; +using System.Text.RegularExpressions; + +namespace LogLibrary.Log +{ + + public unsafe class Log + { + private string m_Name; + private const string m_MessageTemplate = "{0}-{1}: {2}"; + + private const string m_Debug = "DEBUG"; + + private const string m_Error = "ERROR"; + + private const string m_Fatal = "FATAL"; + + private const string m_Info = "INFO"; + + private const string m_Warn = "WARN"; + + /// <summary> + /// Initializes a new instance of the <see cref="Log"/> class. + /// </summary> + /// <param name="name">The name.</param> + public Log(string name) + { + m_Name = name; + } + public Log() + { + m_Name = "NaN"; + } + + /// <summary> + /// Gets a value indicating whether this instance is debug enabled. + /// </summary> + /// <value> + /// <c>true</c> if this instance is debug enabled; otherwise, <c>false</c>. + /// </value> + public bool IsDebugEnabled + { + get { return true; } + } + + /// <summary> + /// Gets a value indicating whether this instance is error enabled. + /// </summary> + /// <value> + /// <c>true</c> if this instance is error enabled; otherwise, <c>false</c>. + /// </value> + public bool IsErrorEnabled + { + get { return true; } + } + + /// <summary> + /// Gets a value indicating whether this instance is fatal enabled. + /// </summary> + /// <value> + /// <c>true</c> if this instance is fatal enabled; otherwise, <c>false</c>. + /// </value> + public bool IsFatalEnabled + { + get { return true; } + } + + /// <summary> + /// Gets a value indicating whether this instance is info enabled. + /// </summary> + /// <value> + /// <c>true</c> if this instance is info enabled; otherwise, <c>false</c>. + /// </value> + public bool IsInfoEnabled + { + get { return true; } + } + + /// <summary> + /// Gets a value indicating whether this instance is warn enabled. + /// </summary> + /// <value> + /// <c>true</c> if this instance is warn enabled; otherwise, <c>false</c>. + /// </value> + public bool IsWarnEnabled + { + get { return true; } + } + + + + public string GetDataTimeLog(string log) + { + return string.Format("[{0}] >> {1}", DateTime.Now.ToString("yy-MM-dd HH:mm:ss"), log); + } + + /// <summary> + /// Logs the debug message. + /// </summary> + /// <param name="isWriteFile"></param> + /// <param name="message">The message.</param> + public void Debug(bool isWriteFile, object message) + { + string log = GetDataTimeLog(message.ToString()); + Console.WriteLine(m_MessageTemplate, m_Name, m_Debug, log); + if (isWriteFile) + { + LogUtil.WriteLogFile(m_Name, m_Debug, log); + } + } + + /// <summary> + /// Logs the debug message. + /// </summary> + /// <param name="isWriteFile"></param> + /// <param name="message">The message.</param> + /// <param name="exception">The exception.</param> + public void Debug(bool isWriteFile, object message, Exception exception) + { + string log = GetDataTimeLog(message + Environment.NewLine + exception.Message + exception.StackTrace); + Console.WriteLine(m_MessageTemplate, m_Name, m_Debug, log); + if (isWriteFile) + { + LogUtil.WriteLogFile(m_Name, m_Debug, log); + } + } + + /// <summary> + /// Logs the debug message. + /// </summary> + /// <param name="isWriteFile"></param> + /// <param name="format">The format.</param> + /// <param name="arg0">The arg0.</param> + public void DebugFormat(bool isWriteFile, string format, object arg0) + { + string log = GetDataTimeLog(string.Format(format, arg0)); + Console.WriteLine(m_MessageTemplate, m_Name, m_Debug, log); + if (isWriteFile) + { + LogUtil.WriteLogFile(m_Name, m_Debug, log); + } + } + + /// <summary> + /// Logs the debug message. + /// </summary> + /// <param name="isWriteFile"></param> + /// <param name="format">The format.</param> + /// <param name="args">The args.</param> + public void DebugFormat(bool isWriteFile, string format, params object[] args) + { + string log = GetDataTimeLog(string.Format(format, args)); + Console.WriteLine(m_MessageTemplate, m_Name, m_Debug, string.Format(format, args)); + if (isWriteFile) + { + LogUtil.WriteLogFile(m_Name, m_Debug, log); + } + } + + /// <summary> + /// Logs the debug message. + /// </summary> + /// <param name="isWriteFile"></param> + /// <param name="provider">The provider.</param> + /// <param name="format">The format.</param> + /// <param name="args">The args.</param> + public void DebugFormat(bool isWriteFile, IFormatProvider provider, string format, params object[] args) + { + string log = GetDataTimeLog(string.Format(format, args)); + Console.WriteLine(m_MessageTemplate, m_Name, m_Debug, string.Format(provider, format, args)); + if (isWriteFile) + { + LogUtil.WriteLogFile(m_Name, m_Debug, log); + } + } + + /// <summary> + /// Logs the debug message. + /// </summary> + /// <param name="isWriteFile"></param> + /// <param name="format">The format.</param> + /// <param name="arg0">The arg0.</param> + /// <param name="arg1">The arg1.</param> + public void DebugFormat(bool isWriteFile, string format, object arg0, object arg1) + { + string log = GetDataTimeLog(string.Format(format, arg0, arg1)); + Console.WriteLine(m_MessageTemplate, m_Name, m_Debug, log); + if (isWriteFile) + { + LogUtil.WriteLogFile(m_Name, m_Debug, log); + } + } + + /// <summary> + /// Logs the debug message. + /// </summary> + /// <param name="isWriteFile"></param> + /// <param name="format">The format.</param> + /// <param name="arg0">The arg0.</param> + /// <param name="arg1">The arg1.</param> + /// <param name="arg2">The arg2.</param> + public void DebugFormat(bool isWriteFile, string format, object arg0, object arg1, object arg2) + { + string log = GetDataTimeLog(string.Format(format, arg0, arg1, arg2)); + Console.WriteLine(m_MessageTemplate, m_Name, m_Debug, log); + if (isWriteFile) + { + LogUtil.WriteLogFile(m_Name, m_Debug, log); + } + } + + /// <summary> + /// Logs the error message. + /// </summary> + /// <param name="isWriteFile"></param> + /// <param name="message">The message.</param> + public void Error(bool isWriteFile, object message) + { + string log = GetDataTimeLog(message.ToString()); + Console.WriteLine(m_MessageTemplate, m_Name, m_Error, log); + if (isWriteFile) + { + LogUtil.WriteLogFile(m_Name, m_Error, log); + } + } + + /// <summary> + /// Logs the error message. + /// </summary> + /// <param name="isWriteFile"></param> + /// <param name="message">The message.</param> + /// <param name="exception">The exception.</param> + public void Error(bool isWriteFile, object message, Exception exception) + { + //string log = GetDataTimeLog(message + Environment.NewLine + exception.Message + exception.StackTrace); + string log = GetDataTimeLog(message + Environment.NewLine + exception.Message ); + Console.WriteLine(m_MessageTemplate, m_Name, m_Error, log); + if (isWriteFile) + { + LogUtil.WriteLogFile(m_Name, m_Error, log); + } + } + + /// <summary> + /// Logs the error message. + /// </summary> + /// <param name="isWriteFile"></param> + /// <param name="format">The format.</param> + /// <param name="arg0">The arg0.</param> + public void ErrorFormat(bool isWriteFile, string format, object arg0) + { + string log = GetDataTimeLog(string.Format(format, arg0)); + Console.WriteLine(m_MessageTemplate, m_Name, m_Error, log); + if (isWriteFile) + { + LogUtil.WriteLogFile(m_Name, m_Error, log); + } + } + + /// <summary> + /// Logs the error message. + /// </summary> + /// <param name="isWriteFile"></param> + /// <param name="format">The format.</param> + /// <param name="args">The args.</param> + public void ErrorFormat(bool isWriteFile, string format, params object[] args) + { + string log = GetDataTimeLog(string.Format(format, args)); + Console.WriteLine(m_MessageTemplate, m_Name, m_Error, log); + if (isWriteFile) + { + LogUtil.WriteLogFile(m_Name, m_Error, log); + } + } + + /// <summary> + /// Logs the error message. + /// </summary> + /// <param name="isWriteFile"></param> + /// <param name="provider">The provider.</param> + /// <param name="format">The format.</param> + /// <param name="args">The args.</param> + public void ErrorFormat(bool isWriteFile, IFormatProvider provider, string format, params object[] args) + { + string log = GetDataTimeLog(string.Format(provider, format, args)); + Console.WriteLine(m_MessageTemplate, m_Name, m_Error, log); + if (isWriteFile) + { + LogUtil.WriteLogFile(m_Name, m_Error, log); + } + } + + /// <summary> + /// Logs the error message. + /// </summary> + /// <param name="isWriteFile"></param> + /// <param name="format">The format.</param> + /// <param name="arg0">The arg0.</param> + /// <param name="arg1">The arg1.</param> + public void ErrorFormat(bool isWriteFile, string format, object arg0, object arg1) + { + string log = GetDataTimeLog(string.Format(format, arg0, arg1)); + Console.WriteLine(m_MessageTemplate, m_Name, m_Error, log); + if (isWriteFile) + { + LogUtil.WriteLogFile(m_Name, m_Error, log); + } + } + + /// <summary> + /// Logs the error message. + /// </summary> + /// <param name="isWriteFile"></param> + /// <param name="format">The format.</param> + /// <param name="arg0">The arg0.</param> + /// <param name="arg1">The arg1.</param> + /// <param name="arg2">The arg2.</param> + public void ErrorFormat(bool isWriteFile, string format, object arg0, object arg1, object arg2) + { + string log = GetDataTimeLog(string.Format(format, arg0, arg2)); + Console.WriteLine(m_MessageTemplate, m_Name, m_Error, log); + if (isWriteFile) + { + LogUtil.WriteLogFile(m_Name, m_Error, log); + } + } + + /// <summary> + /// Logs the fatal error message. + /// </summary> + /// <param name="isWriteFile"></param> + /// <param name="message">The message.</param> + public void Fatal(bool isWriteFile, object message) + { + string log = GetDataTimeLog(message.ToString()); + Console.WriteLine(m_MessageTemplate, m_Name, m_Fatal, log); + if (isWriteFile) + { + LogUtil.WriteLogFile(m_Name, m_Fatal, log); + } + } + + /// <summary> + /// Logs the fatal error message. + /// </summary> + /// <param name="isWriteFile"></param> + /// <param name="message">The message.</param> + /// <param name="exception">The exception.</param> + public void Fatal(bool isWriteFile, object message, Exception exception) + { + string log = GetDataTimeLog(message + Environment.NewLine + exception.Message + exception.StackTrace); + Console.WriteLine(m_MessageTemplate, m_Name, m_Fatal, log); + if (isWriteFile) + { + LogUtil.WriteLogFile(m_Name, m_Fatal, log); + } + } + + /// <summary> + /// Logs the fatal error message. + /// </summary> + /// <param name="isWriteFile"></param> + /// <param name="format">The format.</param> + /// <param name="arg0">The arg0.</param> + public void FatalFormat(bool isWriteFile, string format, object arg0) + { + string log = GetDataTimeLog(string.Format(format, arg0)); + Console.WriteLine(m_MessageTemplate, m_Name, m_Fatal, log); + if (isWriteFile) + { + LogUtil.WriteLogFile(m_Name, m_Fatal, log); + } + } + + /// <summary> + /// Logs the fatal error message. + /// </summary> + /// <param name="isWriteFile"></param> + /// <param name="format">The format.</param> + /// <param name="args">The args.</param> + public void FatalFormat(bool isWriteFile, string format, params object[] args) + { + string log = GetDataTimeLog(string.Format(format, args)); + Console.WriteLine(m_MessageTemplate, m_Name, m_Fatal, log); + if (isWriteFile) + { + LogUtil.WriteLogFile(m_Name, m_Fatal, log); + } + } + + /// <summary> + /// Logs the fatal error message. + /// </summary> + /// <param name="isWriteFile"></param> + /// <param name="provider">The provider.</param> + /// <param name="format">The format.</param> + /// <param name="args">The args.</param> + public void FatalFormat(bool isWriteFile, IFormatProvider provider, string format, params object[] args) + { + string log = GetDataTimeLog(string.Format(provider, format, args)); + Console.WriteLine(m_MessageTemplate, m_Name, m_Fatal, log); + if (isWriteFile) + { + LogUtil.WriteLogFile(m_Name, m_Fatal, log); + } + } + + /// <summary> + /// Logs the fatal error message. + /// </summary> + /// <param name="isWriteFile"></param> + /// <param name="format">The format.</param> + /// <param name="arg0">The arg0.</param> + /// <param name="arg1">The arg1.</param> + public void FatalFormat(bool isWriteFile, string format, object arg0, object arg1) + { + string log = GetDataTimeLog(string.Format(format, arg0, arg1)); + Console.WriteLine(m_MessageTemplate, m_Name, m_Fatal, log); + if (isWriteFile) + { + LogUtil.WriteLogFile(m_Name, m_Fatal, log); + } + } + + /// <summary> + /// Logs the fatal error message. + /// </summary> + /// <param name="isWriteFile"></param> + /// <param name="format">The format.</param> + /// <param name="arg0">The arg0.</param> + /// <param name="arg1">The arg1.</param> + /// <param name="arg2">The arg2.</param> + public void FatalFormat(bool isWriteFile, string format, object arg0, object arg1, object arg2) + { + string log = GetDataTimeLog(string.Format(format, arg0, arg1, arg2)); + Console.WriteLine(m_MessageTemplate, m_Name, m_Fatal, log); + if (isWriteFile) + { + LogUtil.WriteLogFile(m_Name, m_Fatal, log); + } + } + + /// <summary> + /// Logs the info message. + /// </summary> + /// <param name="isWriteFile"></param> + /// <param name="message">The message.</param> + public void Info(bool isWriteFile, object message) + { + string log = GetDataTimeLog(message.ToString()); + Console.WriteLine(m_MessageTemplate, m_Name, m_Info, log); + if (isWriteFile) + { + LogUtil.WriteLogFile(m_Name, m_Info, log); + } + } + + /// <summary> + /// Logs the info message. + /// </summary> + /// <param name="isWriteFile"></param> + /// <param name="message">The message.</param> + /// <param name="exception">The exception.</param> + public void Info(bool isWriteFile, object message, Exception exception) + { + string log = GetDataTimeLog(message + Environment.NewLine + exception.Message + exception.StackTrace); + Console.WriteLine(m_MessageTemplate, m_Name, m_Info, log); + if (isWriteFile) + { + LogUtil.WriteLogFile(m_Name, m_Info, log); + } + } + + /// <summary> + /// Logs the info message. + /// </summary> + /// <param name="isWriteFile"></param> + /// <param name="format">The format.</param> + /// <param name="arg0">The arg0.</param> + public void InfoFormat(bool isWriteFile, string format, object arg0) + { + string log = GetDataTimeLog(string.Format("\n{0}\n{1}\n-----------------------------------------------------------\n\n", format, arg0)); + Console.WriteLine(m_MessageTemplate, m_Name, m_Info, log); + if (isWriteFile) + { + LogUtil.WriteLogFile(m_Name, m_Info, log); + } + } + + /// <summary> + /// Logs the info message. + /// </summary> + /// <param name="isWriteFile"></param> + /// <param name="format">The format.</param> + /// <param name="args">The args.</param> + //public void InfoFormat(bool isWriteFile, string format, params object[] args) + //{ + // string log = GetDataTimeLog(string.Format(format, args)); + // Console.WriteLine(m_MessageTemplate, m_Name, m_Info, log); + // if (isWriteFile) + // { + // LogUtil.WriteLogFile(m_Name, m_Info, log); + // } + //} + + /// <summary> + /// Logs the info message. + /// </summary> + /// <param name="isWriteFile"></param> + /// <param name="provider">The provider.</param> + /// <param name="format">The format.</param> + /// <param name="args">The args.</param> + //public void InfoFormat(bool isWriteFile, IFormatProvider provider, string format, params object[] args) + //{ + // string log = GetDataTimeLog(string.Format(provider, format, args)); + // Console.WriteLine(m_MessageTemplate, m_Name, m_Info, log); + // if (isWriteFile) + // { + // LogUtil.WriteLogFile(m_Name, m_Info, log); + // } + //} + + /// <summary> + /// Logs the info message. + /// </summary> + /// <param name="isWriteFile"></param> + /// <param name="format">The format.</param> + /// <param name="arg0">The arg0.</param> + /// <param name="arg1">The arg1.</param> + //public void InfoFormat(bool isWriteFile, string format, object arg0, object arg1) + //{ + // string log = GetDataTimeLog(string.Format(format, arg0, arg1)); + // Console.WriteLine(m_MessageTemplate, m_Name, m_Info, log); + // if (isWriteFile) + // { + // LogUtil.WriteLogFile(m_Name, m_Info, log); + // } + //} + + /// <summary> + /// Logs the info message. + /// </summary> + /// <param name="isWriteFile"></param> + /// <param name="format">The format.</param> + /// <param name="arg0">The arg0.</param> + /// <param name="arg1">The arg1.</param> + /// <param name="arg2">The arg2.</param> + public void InfoFormat(bool isWriteFile, object arg0, object arg1, object arg2) + { + string func(string str, int len) + { + var strSLen = Regex.Replace(str, @"[^\x00-\xff]", "aa").Length; + var strLen = str.Length; + return str.PadLeft(len - strSLen + strLen); + } + string log = GetDataTimeLog(string.Format("[{0}]\t[{1}]\t{2}", arg0?.ToString(), arg1?.ToString(), arg2)); + //string log = GetDataTimeLog(string.Format("[{0}] [{1}] {2}", func(arg0?.ToString(), 13), func(arg1?.ToString(), 16), arg2)); + //Console.WriteLine(m_MessageTemplate, m_Name, m_Info, log); + if (isWriteFile) + { + LogUtil.WriteLogFile(m_Name, m_Info, log); + } + } + + /// <summary> + /// Logs the warning message. + /// </summary> + /// <param name="isWriteFile"></param> + /// <param name="message">The message.</param> + public void Warn(bool isWriteFile, object message) + { + string log = GetDataTimeLog(message.ToString()); + Console.WriteLine(m_MessageTemplate, m_Name, m_Warn, log); + if (isWriteFile) + { + LogUtil.WriteLogFile(m_Name, m_Warn, log); + } + } + + /// <summary> + /// Logs the warning message. + /// </summary> + /// <param name="isWriteFile"></param> + /// <param name="message">The message.</param> + /// <param name="exception">The exception.</param> + public void Warn(bool isWriteFile, object message, Exception exception) + { + string log = GetDataTimeLog(message + Environment.NewLine + exception.Message + exception.StackTrace); + Console.WriteLine(m_MessageTemplate, m_Name, m_Warn, log); + if (isWriteFile) + { + LogUtil.WriteLogFile(m_Name, m_Warn, log); + } + } + + /// <summary> + /// Logs the warning message. + /// </summary> + /// <param name="isWriteFile"></param> + /// <param name="format">The format.</param> + /// <param name="arg0">The arg0.</param> + public void WarnFormat(bool isWriteFile, string format, object arg0) + { + string log = GetDataTimeLog(string.Format(format, arg0)); + Console.WriteLine(m_MessageTemplate, m_Name, m_Warn, log); + if (isWriteFile) + { + LogUtil.WriteLogFile(m_Name, m_Warn, log); + } + } + + /// <summary> + /// Logs the warning message. + /// </summary> + /// <param name="isWriteFile"></param> + /// <param name="format">The format.</param> + /// <param name="args">The args.</param> + public void WarnFormat(bool isWriteFile, string format, params object[] args) + { + string log = GetDataTimeLog(string.Format(format, args)); + Console.WriteLine(m_MessageTemplate, m_Name, m_Warn, log); + if (isWriteFile) + { + LogUtil.WriteLogFile(m_Name, m_Warn, log); + } + } + + /// <summary> + /// Logs the warning message. + /// </summary> + /// <param name="isWriteFile"></param> + /// <param name="provider">The provider.</param> + /// <param name="format">The format.</param> + /// <param name="args">The args.</param> + public void WarnFormat(bool isWriteFile, IFormatProvider provider, string format, params object[] args) + { + string log = GetDataTimeLog(string.Format(provider, format, args)); + Console.WriteLine(m_MessageTemplate, m_Name, m_Warn, log); + if (isWriteFile) + { + LogUtil.WriteLogFile(m_Name, m_Warn, log); + } + } + + /// <summary> + /// Logs the warning message. + /// </summary> + /// <param name="isWriteFile"></param> + /// <param name="format">The format.</param> + /// <param name="arg0">The arg0.</param> + /// <param name="arg1">The arg1.</param> + public void WarnFormat(bool isWriteFile, string format, object arg0, object arg1) + { + string log = GetDataTimeLog(string.Format(format, arg0, arg1)); + Console.WriteLine(m_MessageTemplate, m_Name, m_Warn, log); + if (isWriteFile) + { + LogUtil.WriteLogFile(m_Name, m_Warn, log); + } + } + + /// <summary> + /// Logs the warning message. + /// </summary> + /// <param name="isWriteFile"></param> + /// <param name="format">The format.</param> + /// <param name="arg0">The arg0.</param> + /// <param name="arg1">The arg1.</param> + /// <param name="arg2">The arg2.</param> + public void WarnFormat(bool isWriteFile, string format, object arg0, object arg1, object arg2) + { + string log = GetDataTimeLog(string.Format(format, arg0, arg1, arg2)); + Console.WriteLine(m_MessageTemplate, m_Name, m_Warn, log); + if (isWriteFile) + { + LogUtil.WriteLogFile(m_Name, m_Warn, log); + } + } + + //public void Behavior(string logMsg, Level level) + //{ + // lock (this) + // { + // m_Name = "琛屼负"; + // switch (level) + // { + // case Level.Debug: + // Debug(true, logMsg); + // break; + // case Level.Info: + // Info(true, logMsg); + // break; + // case Level.Warning: + // Warn(true, logMsg); + // break; + // case Level.Error: + // Error(true, logMsg); + // break; + // default: + // break; + // } + // } + //} + + //public void Interface(string logMsg, Level level) + //{ + // lock (this) + // { + // m_Name = "鎺ュ彛"; + // switch (level) + // { + // case Level.Debug: + // Debug(true, logMsg); + // break; + // case Level.Info: + // Info(true, logMsg); + // break; + // case Level.Warning: + // Warn(true, logMsg); + // break; + // case Level.Error: + // Error(true, logMsg); + // break; + // default: + // break; + // } + // } + //} + + //public void Hardware(string logMsg, Level level) + //{ + // lock (this) + // { + // m_Name = "纭欢"; + // switch (level) + // { + // case Level.Debug: + // Debug(true, logMsg); + // break; + // case Level.Info: + // Info(true, logMsg); + // break; + // case Level.Warning: + // Warn(true, logMsg); + // break; + // case Level.Error: + // Error(true, logMsg); + // break; + // default: + // break; + // } + // } + //} + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/LogLibrary/Log/LogFactory.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/LogLibrary/Log/LogFactory.cs" new file mode 100644 index 0000000..218faa9 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/LogLibrary/Log/LogFactory.cs" @@ -0,0 +1,11 @@ +锘� +namespace LogLibrary.Log +{ + public unsafe class LogFactory + { + public Log GetLog(string name) + { + return new Log(name); + } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/LogLibrary/Log/LogUtil.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/LogLibrary/Log/LogUtil.cs" new file mode 100644 index 0000000..9dd32fa --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/LogLibrary/Log/LogUtil.cs" @@ -0,0 +1,57 @@ +锘縰sing System; +using System.Diagnostics; +using System.Threading; + +namespace LogLibrary.Log +{ + internal unsafe class LogUtil + { + static ReaderWriterLockSlim lockSlim = new ReaderWriterLockSlim(); + + /// <summary> + /// 鏍煎紡寮忓寲Log淇℃伅 + /// </summary> + /// <param name="format"></param> + /// <param name="name"></param> + /// <param name="logType"></param> + /// <param name="log"></param> + /// <returns></returns> + private static string GetLogString(string name, string logType, string log) + { + return string.Format("[{0}]{1}-{2}: {3}", DateTime.Now.ToString("HH:mm:ss"), name, logType, log); + } + + /// <summary> + /// 鑾峰緱鏃ュ織瑕佷繚瀛樼殑璺緞 + /// </summary> + /// <param name="name"></param> + /// <param name="logType"></param> + /// <returns></returns> + private static string GetLogPath(string name, string logType) + { + string path = AppDomain.CurrentDomain.BaseDirectory + $"Logs/{DateTime.Now:yyyyMM}"; + if (!System.IO.Directory.Exists(path)) + { + System.IO.Directory.CreateDirectory(path); + } + + return System.IO.Path.Combine(path, string.Format("{0}_{1}_{2}.log", DateTime.Now.ToString("yyyy-MM-dd"), name, logType)); + } + + public static void WriteLogFile(string name, string logType, string log) + { + string logPath = GetLogPath(name, logType); + Trace.WriteLine(log); + lockSlim.EnterWriteLock();//鎵撳紑鍐欐搷浣滈攣 + try + { + FileUtil.WriteAppend(logPath, log); + } + finally + { + lockSlim.ExitWriteLock(); + } + + } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/LogLibrary/Properties/AssemblyInfo.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/LogLibrary/Properties/AssemblyInfo.cs" new file mode 100644 index 0000000..a6c4576 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/LogLibrary/Properties/AssemblyInfo.cs" @@ -0,0 +1,36 @@ +锘縰sing System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// 鏈夊叧绋嬪簭闆嗙殑涓�鑸俊鎭敱浠ヤ笅 +// 鎺у埗銆傛洿鏀硅繖浜涚壒鎬у�煎彲淇敼 +// 涓庣▼搴忛泦鍏宠仈鐨勪俊鎭�� +[assembly: AssemblyTitle("LogLibrary")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("LogLibrary")] +[assembly: AssemblyCopyright("Copyright 漏 2020")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// 灏� ComVisible 璁剧疆涓� false 浼氫娇姝ょ▼搴忛泦涓殑绫诲瀷 +//瀵� COM 缁勪欢涓嶅彲瑙併�傚鏋滈渶瑕佷粠 COM 璁块棶姝ょ▼搴忛泦涓殑绫诲瀷 +//璇峰皢姝ょ被鍨嬬殑 ComVisible 鐗规�ц缃负 true銆� +[assembly: ComVisible(false)] + +// 濡傛灉姝ら」鐩悜 COM 鍏紑锛屽垯涓嬪垪 GUID 鐢ㄤ簬绫诲瀷搴撶殑 ID +[assembly: Guid("2e0d9770-ab36-4811-a0d0-05b98093b92d")] + +// 绋嬪簭闆嗙殑鐗堟湰淇℃伅鐢变笅鍒楀洓涓�肩粍鎴�: +// +// 涓荤増鏈� +// 娆$増鏈� +// 鐢熸垚鍙� +// 淇鍙� +// +//鍙互鎸囧畾鎵�鏈夎繖浜涘�硷紝涔熷彲浠ヤ娇鐢ㄢ�滅敓鎴愬彿鈥濆拰鈥滀慨璁㈠彿鈥濈殑榛樿鍊� +//閫氳繃浣跨敤 "*"锛屽涓嬫墍绀�: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_BusinessServices/Dt_AreaInfoService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_BusinessServices/Dt_AreaInfoService.cs" new file mode 100644 index 0000000..c34db7d --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_BusinessServices/Dt_AreaInfoService.cs" @@ -0,0 +1,18 @@ +锘縰sing WIDESEA_Core.BaseRepository; +using WIDESEA_Core.BaseServices; +using WIDESEA_IBusinessesRepository; +using WIDESEA_IBusinessServices; +using WIDESEA_Model.Models; + +namespace WIDESEA_BusinessServices +{ + public class Dt_AreaInfoService : ServiceBase<Dt_AreaInfo, IDt_AreaInfoRepository>, IDt_AreaInfoService + { + private readonly IUnitOfWorkManage _unitOfWorkManage; + public Dt_AreaInfoService(IDt_AreaInfoRepository BaseDal, IUnitOfWorkManage unitOfWorkManage) : base(BaseDal) + { + _unitOfWorkManage = unitOfWorkManage; + } + + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_BusinessServices/Dt_MaterielAttributeService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_BusinessServices/Dt_MaterielAttributeService.cs" new file mode 100644 index 0000000..b7ebdcb --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_BusinessServices/Dt_MaterielAttributeService.cs" @@ -0,0 +1,18 @@ +锘縰sing WIDESEA_Core.BaseRepository; +using WIDESEA_Core.BaseServices; +using WIDESEA_IBusinessesRepository; +using WIDESEA_IBusinessServices; +using WIDESEA_Model.Models; + +namespace WIDESEA_BusinessServices +{ + public class Dt_MaterielAttributeService : ServiceBase<Dt_MaterielAttribute, IDt_MaterielAttributeRepository>, IDt_MaterielAttributeService + { + private readonly IUnitOfWorkManage _unitOfWorkManage; + public Dt_MaterielAttributeService(IDt_MaterielAttributeRepository BaseDal, IUnitOfWorkManage unitOfWorkManage) : base(BaseDal) + { + _unitOfWorkManage = unitOfWorkManage; + } + + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_BusinessServices/Dt_MaterielInfoService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_BusinessServices/Dt_MaterielInfoService.cs" new file mode 100644 index 0000000..b0e4fa9 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_BusinessServices/Dt_MaterielInfoService.cs" @@ -0,0 +1,18 @@ +锘縰sing WIDESEA_Core.BaseRepository; +using WIDESEA_Core.BaseServices; +using WIDESEA_IBusinessesRepository; +using WIDESEA_IBusinessServices; +using WIDESEA_Model.Models; + +namespace WIDESEA_BusinessServices +{ + public class Dt_MaterielInfoService : ServiceBase<Dt_MaterielInfo, IDt_MaterielInfoRepository>, IDt_MaterielInfoService + { + private readonly IUnitOfWorkManage _unitOfWorkManage; + public Dt_MaterielInfoService(IDt_MaterielInfoRepository BaseDal, IUnitOfWorkManage unitOfWorkManage) : base(BaseDal) + { + _unitOfWorkManage = unitOfWorkManage; + } + + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_BusinessServices/Dt_RoadWayInfoService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_BusinessServices/Dt_RoadWayInfoService.cs" new file mode 100644 index 0000000..5994359 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_BusinessServices/Dt_RoadWayInfoService.cs" @@ -0,0 +1,18 @@ +锘縰sing WIDESEA_Core.BaseRepository; +using WIDESEA_Core.BaseServices; +using WIDESEA_IBusinessesRepository; +using WIDESEA_IBusinessServices; +using WIDESEA_Model.Models; + +namespace WIDESEA_BusinessServices +{ + public class Dt_RoadWayInfoService : ServiceBase<Dt_RoadWayInfo, IDt_RoadWayInfoRepository>, IDt_RoadWayInfoService + { + private readonly IUnitOfWorkManage _unitOfWorkManage; + public Dt_RoadWayInfoService(IDt_RoadWayInfoRepository BaseDal, IUnitOfWorkManage unitOfWorkManage) : base(BaseDal) + { + _unitOfWorkManage = unitOfWorkManage; + } + + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_BusinessServices/Dt_StrategyService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_BusinessServices/Dt_StrategyService.cs" new file mode 100644 index 0000000..0dd08a6 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_BusinessServices/Dt_StrategyService.cs" @@ -0,0 +1,18 @@ +锘縰sing WIDESEA_Core.BaseRepository; +using WIDESEA_Core.BaseServices; +using WIDESEA_IBusinessesRepository; +using WIDESEA_IBusinessServices; +using WIDESEA_Model.Models; + +namespace WIDESEA_BusinessServices +{ + public class Dt_StrategyService : ServiceBase<Dt_Strategy, IDt_StrategyRepository>, IDt_StrategyService + { + private readonly IUnitOfWorkManage _unitOfWorkManage; + public Dt_StrategyService(IDt_StrategyRepository BaseDal, IUnitOfWorkManage unitOfWorkManage) : base(BaseDal) + { + _unitOfWorkManage = unitOfWorkManage; + } + + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_BusinessServices/Dt_TaskExecuteDetailService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_BusinessServices/Dt_TaskExecuteDetailService.cs" new file mode 100644 index 0000000..39c5f31 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_BusinessServices/Dt_TaskExecuteDetailService.cs" @@ -0,0 +1,18 @@ +锘縰sing WIDESEA_Core.BaseRepository; +using WIDESEA_Core.BaseServices; +using WIDESEA_IBusinessesRepository; +using WIDESEA_IBusinessServices; +using WIDESEA_Model.Models; + +namespace WIDESEA_BusinessServices +{ + public class Dt_TaskExecuteDetailService : ServiceBase<Dt_TaskExecuteDetail, IDt_TaskExecuteDetailRepository>, IDt_TaskExecuteDetailService + { + private readonly IUnitOfWorkManage _unitOfWorkManage; + public Dt_TaskExecuteDetailService(IDt_TaskExecuteDetailRepository BaseDal, IUnitOfWorkManage unitOfWorkManage) : base(BaseDal) + { + _unitOfWorkManage = unitOfWorkManage; + } + + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_BusinessServices/Dt_TypeMappingService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_BusinessServices/Dt_TypeMappingService.cs" new file mode 100644 index 0000000..4eec346 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_BusinessServices/Dt_TypeMappingService.cs" @@ -0,0 +1,18 @@ +锘縰sing WIDESEA_Core.BaseRepository; +using WIDESEA_Core.BaseServices; +using WIDESEA_IBusinessesRepository; +using WIDESEA_IBusinessServices; +using WIDESEA_Model.Models; + +namespace WIDESEA_BusinessServices +{ + public class Dt_TypeMappingService : ServiceBase<Dt_TypeMapping, IDt_TypeMappingRepository>, IDt_TypeMappingService + { + private readonly IUnitOfWorkManage _unitOfWorkManage; + public Dt_TypeMappingService(IDt_TypeMappingRepository BaseDal, IUnitOfWorkManage unitOfWorkManage) : base(BaseDal) + { + _unitOfWorkManage = unitOfWorkManage; + } + + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_BusinessServices/Dt_UnitInfoService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_BusinessServices/Dt_UnitInfoService.cs" new file mode 100644 index 0000000..a61e7f7 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_BusinessServices/Dt_UnitInfoService.cs" @@ -0,0 +1,18 @@ +锘縰sing WIDESEA_Core.BaseRepository; +using WIDESEA_Core.BaseServices; +using WIDESEA_IBusinessesRepository; +using WIDESEA_IBusinessServices; +using WIDESEA_Model.Models; + +namespace WIDESEA_BusinessServices +{ + public class Dt_UnitInfoService : ServiceBase<Dt_UnitInfo, IDt_UnitInfoRepository>, IDt_UnitInfoService + { + private readonly IUnitOfWorkManage _unitOfWorkManage; + public Dt_UnitInfoService(IDt_UnitInfoRepository BaseDal, IUnitOfWorkManage unitOfWorkManage) : base(BaseDal) + { + _unitOfWorkManage = unitOfWorkManage; + } + + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_BusinessServices/Dt_WareAreaInfoService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_BusinessServices/Dt_WareAreaInfoService.cs" new file mode 100644 index 0000000..6a94b9f --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_BusinessServices/Dt_WareAreaInfoService.cs" @@ -0,0 +1,18 @@ +锘縰sing WIDESEA_Core.BaseRepository; +using WIDESEA_Core.BaseServices; +using WIDESEA_IBusinessesRepository; +using WIDESEA_IBusinessServices; +using WIDESEA_Model.Models; + +namespace WIDESEA_BusinessServices +{ + public class Dt_WareAreaInfoService : ServiceBase<Dt_WareAreaInfo, IDt_WareAreaInfoRepository>, IDt_WareAreaInfoService + { + private readonly IUnitOfWorkManage _unitOfWorkManage; + public Dt_WareAreaInfoService(IDt_WareAreaInfoRepository BaseDal, IUnitOfWorkManage unitOfWorkManage) : base(BaseDal) + { + _unitOfWorkManage = unitOfWorkManage; + } + + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_BusinessesRepository/Dt_AreaInfoRepository.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_BusinessesRepository/Dt_AreaInfoRepository.cs" new file mode 100644 index 0000000..3e594dc --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_BusinessesRepository/Dt_AreaInfoRepository.cs" @@ -0,0 +1,16 @@ +锘縰sing SqlSugar; +using System.Linq.Expressions; +using WIDESEA_Core; +using WIDESEA_Core.BaseRepository; +using WIDESEA_IBusinessesRepository; +using WIDESEA_Model.Models; + +namespace WIDESEA_Repository +{ + public class Dt_AreaInfoRepository : RepositoryBase<Dt_AreaInfo>, IDt_AreaInfoRepository + { + public Dt_AreaInfoRepository(IUnitOfWorkManage unitOfWorkManage) : base(unitOfWorkManage) + { + } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_BusinessesRepository/Dt_MaterielAttributeRepository.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_BusinessesRepository/Dt_MaterielAttributeRepository.cs" new file mode 100644 index 0000000..b74e9af --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_BusinessesRepository/Dt_MaterielAttributeRepository.cs" @@ -0,0 +1,13 @@ +锘縰sing WIDESEA_Core.BaseRepository; +using WIDESEA_IBusinessesRepository; +using WIDESEA_Model.Models; + +namespace WIDESEA_Repository +{ + public class Dt_MaterielAttributeRepository : RepositoryBase<Dt_MaterielAttribute>, IDt_MaterielAttributeRepository + { + public Dt_MaterielAttributeRepository(IUnitOfWorkManage unitOfWorkManage) : base(unitOfWorkManage) + { + } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_BusinessesRepository/Dt_MaterielInfoRepository.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_BusinessesRepository/Dt_MaterielInfoRepository.cs" new file mode 100644 index 0000000..a2b395a --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_BusinessesRepository/Dt_MaterielInfoRepository.cs" @@ -0,0 +1,13 @@ +锘縰sing WIDESEA_Core.BaseRepository; +using WIDESEA_IBusinessesRepository; +using WIDESEA_Model.Models; + +namespace WIDESEA_Repository +{ + public class Dt_MaterielInfoRepository : RepositoryBase<Dt_MaterielInfo>, IDt_MaterielInfoRepository + { + public Dt_MaterielInfoRepository(IUnitOfWorkManage unitOfWorkManage) : base(unitOfWorkManage) + { + } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_BusinessesRepository/Dt_RoadWayInfoRepository.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_BusinessesRepository/Dt_RoadWayInfoRepository.cs" new file mode 100644 index 0000000..e4246bf --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_BusinessesRepository/Dt_RoadWayInfoRepository.cs" @@ -0,0 +1,13 @@ +锘縰sing WIDESEA_Core.BaseRepository; +using WIDESEA_IBusinessesRepository; +using WIDESEA_Model.Models; + +namespace WIDESEA_Repository +{ + public class Dt_RoadWayInfoRepository : RepositoryBase<Dt_RoadWayInfo>, IDt_RoadWayInfoRepository + { + public Dt_RoadWayInfoRepository(IUnitOfWorkManage unitOfWorkManage) : base(unitOfWorkManage) + { + } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_BusinessesRepository/Dt_StrategyRepository.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_BusinessesRepository/Dt_StrategyRepository.cs" new file mode 100644 index 0000000..32dadf4 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_BusinessesRepository/Dt_StrategyRepository.cs" @@ -0,0 +1,13 @@ +锘縰sing WIDESEA_Core.BaseRepository; +using WIDESEA_IBusinessesRepository; +using WIDESEA_Model.Models; + +namespace WIDESEA_Repository +{ + public class Dt_StrategyRepository : RepositoryBase<Dt_Strategy>, IDt_StrategyRepository + { + public Dt_StrategyRepository(IUnitOfWorkManage unitOfWorkManage) : base(unitOfWorkManage) + { + } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_BusinessesRepository/Dt_TaskExecuteDetailRepository.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_BusinessesRepository/Dt_TaskExecuteDetailRepository.cs" new file mode 100644 index 0000000..195a930 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_BusinessesRepository/Dt_TaskExecuteDetailRepository.cs" @@ -0,0 +1,13 @@ +锘縰sing WIDESEA_Core.BaseRepository; +using WIDESEA_IBusinessesRepository; +using WIDESEA_Model.Models; + +namespace WIDESEA_Repository +{ + public class Dt_TaskExecuteDetailRepository : RepositoryBase<Dt_TaskExecuteDetail>, IDt_TaskExecuteDetailRepository + { + public Dt_TaskExecuteDetailRepository(IUnitOfWorkManage unitOfWorkManage) : base(unitOfWorkManage) + { + } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_BusinessesRepository/Dt_TypeMappingRepository.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_BusinessesRepository/Dt_TypeMappingRepository.cs" new file mode 100644 index 0000000..9958491 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_BusinessesRepository/Dt_TypeMappingRepository.cs" @@ -0,0 +1,13 @@ +锘縰sing WIDESEA_Core.BaseRepository; +using WIDESEA_IBusinessesRepository; +using WIDESEA_Model.Models; + +namespace WIDESEA_Repository +{ + public class Dt_TypeMappingRepository : RepositoryBase<Dt_TypeMapping>, IDt_TypeMappingRepository + { + public Dt_TypeMappingRepository(IUnitOfWorkManage unitOfWorkManage) : base(unitOfWorkManage) + { + } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_BusinessesRepository/Dt_UnitInfoRepository.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_BusinessesRepository/Dt_UnitInfoRepository.cs" new file mode 100644 index 0000000..649de0b --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_BusinessesRepository/Dt_UnitInfoRepository.cs" @@ -0,0 +1,13 @@ +锘縰sing WIDESEA_Core.BaseRepository; +using WIDESEA_IBusinessesRepository; +using WIDESEA_Model.Models; + +namespace WIDESEA_Repository +{ + public class Dt_UnitInfoRepository : RepositoryBase<Dt_UnitInfo>, IDt_UnitInfoRepository + { + public Dt_UnitInfoRepository(IUnitOfWorkManage unitOfWorkManage) : base(unitOfWorkManage) + { + } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_BusinessesRepository/Dt_WareAreaInfoRepository.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_BusinessesRepository/Dt_WareAreaInfoRepository.cs" new file mode 100644 index 0000000..7382727 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_BusinessesRepository/Dt_WareAreaInfoRepository.cs" @@ -0,0 +1,13 @@ +锘縰sing WIDESEA_Core.BaseRepository; +using WIDESEA_IBusinessesRepository; +using WIDESEA_Model.Models; +namespace WIDESEA_Repository +{ + public class Dt_WareAreaInfoRepository : RepositoryBase<Dt_WareAreaInfo>, IDt_WareAreaInfoRepository + { + public Dt_WareAreaInfoRepository(IUnitOfWorkManage unitOfWorkManage) : base(unitOfWorkManage) + { + + } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Common/AGVInterface/Requset/AGVRequsetBase.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Common/AGVInterface/Requset/AGVRequsetBase.cs" new file mode 100644 index 0000000..60d3900 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Common/AGVInterface/Requset/AGVRequsetBase.cs" @@ -0,0 +1,19 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WIDESEA_Comm +{ + public class AGVRequsetBase + { + public string reqCode { get; set; } + + //public string reqTime { get; set; } + + public string clientCode { get; set; } + + //public string tokenCode { get; set; } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Common/AGVInterface/Requset/RequsetContext/bindCtnrAndBin.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Common/AGVInterface/Requset/RequsetContext/bindCtnrAndBin.cs" new file mode 100644 index 0000000..bfe2cbc --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Common/AGVInterface/Requset/RequsetContext/bindCtnrAndBin.cs" @@ -0,0 +1,51 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WIDESEA_Comm.AGVInterface.Requset +{ + /// <summary> + /// 浠撲綅瑙g粦/缁戝畾 + /// </summary> + public class bindCtnrAndBin : AGVRequsetBase + { + /// <summary> + /// 瀹瑰櫒缂栧彿 + /// </summary> + //public string ctnrCode { get; set; } + + /// <summary> + /// 瀹瑰櫒绫诲瀷 + /// </summary> + public string ctnrTyp { get; set; } + + /// <summary> + /// 浠撲綅缂栧彿锛屼笌浠撲綅缁戝畾瑙g粦蹇呭~ + /// </summary> + public string stgBinCode { get; set; } + + /// <summary> + /// 瀹粨缂栧彿锛屽搴斿涓粨浣嶇紪鍙锋椂鎶ラ敊 + /// </summary> + //public string binName { get; set; } + + /// <summary> + /// 鐗瑰緛鍊硷紝鍙夎溅宸烽亾缁戝畾瀹瑰櫒鍙敤 + /// </summary> + //public string characterValue { get; set; } + + /// <summary> + /// 鍦板浘鏁版嵁缂栧彿锛岀敤浜庤櫄鎷熻揣鏋朵粨浣嶇殑缁戝畾瑙g粦銆� + /// 褰撶粦瀹氭椂锛屼粠璇ョ偣浣嶄笂鐨勮櫄鎷熻揣鏋舵壘涓�涓┖浠撲綅杩涜缁戝畾锛岄『搴忔槸浠庝笅鑷充笂鎼滅储銆� + /// 褰撹В缁戞椂鏍规嵁瀹瑰櫒绫诲瀷鍜屽鍣ㄥ彿杩涜鍖归厤锛岃嫢缁撴灉鏈夊鏉″垯浠庝紭鍏堜粠涓婇儴鐨勪粨浣嶈繘琛岃В缁戙�� + /// </summary> + //public string positionCode { get; set; } + + /// <summary> + /// "1"锛氱粦瀹氾紝 "0"锛氳В缁� + /// </summary> + public string indBind { get; set; } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Common/AGVInterface/Requset/RequsetContext/blockStgBin.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Common/AGVInterface/Requset/RequsetContext/blockStgBin.cs" new file mode 100644 index 0000000..0c0d653 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Common/AGVInterface/Requset/RequsetContext/blockStgBin.cs" @@ -0,0 +1,32 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime; +using System.Text; +using System.Threading.Tasks; + +namespace WIDESEA_Comm.WCSInterface.Requse +{ + /// <summary> + /// 璇ユ帴鍙g敤鍋氭壒閲忕鐢ㄥ惎鐢ㄤ粨浣嶏紝瑕佷箞鍏ㄩ儴鏇存柊鎴愬姛锛岃涔堝叏閮ㄦ洿鏂板け璐ャ�傜敓鎴愯揣鏋跺垵濮嬪寲鐨勪粨浣嶉兘鏄凡鍚敤鐘舵�佺殑銆� + /// 涓婂眰绠$悊浠撲綅鏃堕渶淇濊瘉涓嶳CMS-2000鐨勪粨浣嶇姸鎬佷繚鎸佷竴鑷淬�� + /// </summary> + public class blockStgBin : AGVRequsetBase + { + public object data { get; set; } + } + + public class blockStg + { + /// <summary> + /// 浠撲綅缂栧彿 + + /// </summary> + public string stgBinCode { get;set; } + + /// <summary> + /// 鎿嶄綔绫诲瀷锛�0.鍚敤浠撲綅锛�1.鍚敤浠撲綅 + /// </summary> + public string action { get;} + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Common/AGVInterface/Requset/RequsetContext/cancelTask.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Common/AGVInterface/Requset/RequsetContext/cancelTask.cs" new file mode 100644 index 0000000..bd95731 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Common/AGVInterface/Requset/RequsetContext/cancelTask.cs" @@ -0,0 +1,36 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WIDESEA_Comm.WCSInterface.Requset +{ + /// <summary> + /// 鍙栨秷浠诲姟 + /// </summary> + public class cancelTask : AGVRequsetBase + { + /// <summary> + /// 鍙栨秷绫诲瀷 0琛ㄧず锛氬彇娑堝悗璐ф灦鐩存帴鏀惧湴涓� 1琛ㄧず锛欰GV浠嶇劧鑳岀潃璐ф灦锛� 鏍规嵁鍥炲簱鍖哄煙鎵ц鍥炲簱鎸囦护锛� 鍙湁娼滀紡杞﹀拰CTU杞︽敮鎸併�� 榛樿鐨勫彇娑堟ā寮忎负0 + /// </summary> + public string forceCancel { get; set; } + + /// <summary> + /// forcecancel=1鏃舵湁鎰忎箟锛� 鍥炲簱鍖哄煙缂栧彿锛� 濡傛灉涓虹┖锛岄噰鐢ㄨ揣鏋堕厤缃殑搴撳尯銆� + /// </summary> + public string matterArea { get; set; } + + /// <summary> + /// 鍙栨秷璇GV姝e湪鎵ц鐨勪换鍔″崟 + + /// </summary> + public string agvCode { get; set; } + + /// <summary> + /// 浠诲姟鍗曠紪鍙�, 鍙栨秷璇ヤ换鍔″崟 + /// </summary> + public string taskCode { get; set; } + + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Common/AGVInterface/Requset/RequsetContext/continueTask.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Common/AGVInterface/Requset/RequsetContext/continueTask.cs" new file mode 100644 index 0000000..cad867e --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Common/AGVInterface/Requset/RequsetContext/continueTask.cs" @@ -0,0 +1,61 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WIDESEA_Comm.WCSInterface.Requset +{ + /// <summary> + /// 缁х画鎵ц浠诲姟 + /// taskCode銆乤gvCode銆亀bCode鍜宲odCode鍥涗釜鍙~涓�涓紝濉摢涓渶瑕佷笌浠诲姟妯℃澘閰嶇疆鐨勮Е鍙戠被鍨嬩竴鑷达紝浼樺厛鎺ㄨ崘taskCode + /// </summary> + public class continueTask : AGVRequsetBase + { + /// <summary> + /// 宸ヤ綔浣嶏紝涓嶳CS-2000绔厤缃殑浣嶇疆鍚嶇О涓�鑷� + /// </summary> + public string wbCode { get; set; } + + /// <summary> + /// 璐ф灦鍙凤紝閲囩敤璐ф灦鍙疯Е鍙戠殑鏂瑰紡 + /// </summary> + //public string podCode { get; set; } + + /// <summary> + /// AGV缂栧彿锛岄噰鐢� AGV缂栧彿瑙﹀彂鐨勬柟寮忋�� + /// </summary> + //public string agvCode { get; set; } + + /// <summary> + /// 浠诲姟鍗曞彿锛岄噰鐢� 浠诲姟鍗曠紪鍙疯Е鍙戠殑鏂瑰紡銆� + /// </summary> + public string taskCode { get; set; } + + /// <summary> + /// 涓嬩竴涓瓙浠诲姟鐨勫簭鍒楋紝鎸囧畾绗嚑涓瓙浠诲姟寮�濮嬫墽琛岋紝鏍¢獙瀛愪换鍔℃墽琛屾槸鍚︽纭�備笉濉粯璁ゆ墽琛屼笅涓�涓瓙浠诲姟銆� + /// </summary> + //public string taskSeq { get; set; } + + /// <summary> + /// 涓嬩竴涓綅缃俊鎭紝鍦ㄤ换鍔$被鍨嬩腑閰嶇疆澶栭儴璁剧疆鏃堕渶瑕佷紶鍏ワ紝鍚﹀垯涓嶉渶瑕佽缃�傚緟鐜板満鍦板浘閮ㄧ讲銆侀厤缃畬鎴愬悗鍙幏鍙� + /// </summary> + //public object nextPositionCode { get; set; } + } + + /// <summary> + /// + /// </summary> + public class T + { + /// <summary> + /// 鏍规嵁type濉啓锛屽懠鍙珯鐐�/绛栫暐缂栧彿绛� + /// </summary> + public string positionCode { get; set; } + + /// <summary> + /// 瀵硅薄绫诲瀷瀹氫箟: 00:浠h〃 nextPositionCode鏄竴涓綅缃� 02:浠h〃 nextPositionCode鏄竴涓瓥鐣� + /// </summary> + public string type { get; set;} + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Common/AGVInterface/Requset/RequsetContext/genAgvSchedulingTask.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Common/AGVInterface/Requset/RequsetContext/genAgvSchedulingTask.cs" new file mode 100644 index 0000000..b5f5f51 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Common/AGVInterface/Requset/RequsetContext/genAgvSchedulingTask.cs" @@ -0,0 +1,128 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WIDESEA_Comm.WCSInterface.Requst +{ + public class genAgvSchedulingTask : AGVRequsetBase + { + /// <summary> + /// 浠诲姟绫诲瀷锛屼笌鍦≧CS-2000绔厤缃殑涓讳换鍔$被鍨嬬紪鍙蜂竴鑷淬�� + /// 鍐呯疆浠诲姟绫诲瀷: 鍘傚唴璐ф灦鎼繍: F01 鍘傚唴璐ф灦绌烘弧浜ゆ崲: F02 杈婄瓛鎼繍鎺ラ┏:F03 鍘傚唴璐ф灦鍑哄簱AGV寰呭懡:F04 鏃嬭浆璐ф灦: F05 鍘傚唴鐢垫浠诲姟: + /// F06 浠ヤ笅涓哄弶杞︿笓鐢ㄤ换鍔$被鍨� 楂樹綅璐ф灦鍒板伐浣滃彴: F11 宸ヤ綔鍙板埌楂樹綅璐ф灦: F12 宸烽亾鍒板伐浣滃彴: F13 宸ヤ綔鍙板埌宸烽亾: F14 楂樹綅璐ф灦鍒板伐浣滃彴(鎺ラ┏) : + /// F15 宸ヤ綔鍙板埌楂樹綅璐ф灦 (鎺ラ┏) : F16 宸烽亾鍒板伐浣滃彴(鎺ラ┏) : F17 宸ヤ綔鍙板埌宸烽亾(鎺ラ┏) : F18 鍙夎溅鐢垫涓讳换鍔�: F20 + /// + /// RK:鍏ュ簱 + /// CK:鍑哄簱 + /// </summary> + public string taskTyp { get; set; } + + /// <summary> + /// 瀹瑰櫒绫诲瀷锛堝弶杞�/CTU涓撶敤锛� 鍙夎溅椤圭洰蹇呬紶 //榛樿2 + /// </summary> + public string ctnrTyp { get; set; } + + /// <summary> + /// 瀹瑰櫒缂栧彿锛堝弶杞�/CTU涓撶敤锛� + /// </summary> + //public string ctnrCode { get; set; } + + /// <summary> + /// 瀹瑰櫒鏁伴噺锛堝弶杞﹀爢鍙犱笓鐢級 + /// </summary> + //public string ctnrNum { get; set; } --2024骞�8鏈�27鏃� AGV鏂规洿鏂癛CS-Lite鐗堟湰 绉婚櫎姝ゅ瓧娈� + + /// <summary> + /// 浠诲姟妯″紡 + /// 0-鏅�歮ove + /// 1-鍑哄簱move + /// 2-鍏ュ簱move + /// 3-绉诲簱move + /// 鍑哄簱move妯″紡涓嶈兘琚墦鏂紝鏅�歮ove鍜屽叆搴搈ove鍙互琚墦鏂紝鍑哄簱move鎵ц瀹屽繀椤婚厤鍚堝叆搴搈ove鎴栬�呯Щ搴搈ove鎵ц + /// </summary> + //public string taskMode { get; set; } --2024骞�8鏈�27鏃� AGV鏂规洿鏂癛CS-Lite鐗堟湰 绉婚櫎姝ゅ瓧娈� + + /// <summary> + /// 宸ヤ綔浣嶏紝涓�鑸负鏈哄彴鎴栧伐浣滃彴浣嶇疆锛屼笌RCS-2000绔厤缃殑浣嶇疆鍚嶇О涓�鑷�, 宸ヤ綔浣嶅悕绉颁负瀛楁瘝\鏁板瓧\鎴栫粍鍚�, 涓嶈秴杩�32浣嶃�� + /// </summary> + //public string wbCode { get; set; } + + /// <summary> + /// 浣嶇疆璺緞锛欰GV鍏抽敭璺緞浣嶇疆闆嗗悎锛屼笌浠诲姟绫诲瀷涓ā鏉块厤缃殑鐐硅幏鍙栨柟寮忕珯鐐归泦鍚堜竴涓�瀵瑰簲銆傚緟鐜板満鍦板浘閮ㄧ讲銆侀厤缃畬鎴愬悗鍙幏鍙栥�� + /// </summary> + public List<position> positionCodePath { get; set; } + + /// <summary> + /// 璐ф灦缂栧彿锛屼笉鎸囧畾璐ф灦鍙互涓虹┖ + /// </summary> + //public string podCode { get; set;} + + /// <summary> + /// 鈥�180鈥�,鈥�0鈥�,鈥�90鈥�,鈥�-90鈥� 鍒嗗埆瀵瑰簲鍦板浘鐨勨�濆乏鈥�,鈥濆彸鈥�,鈥濅笂鈥�,鈥濅笅鈥� 锛屼笉鎸囧畾鏂瑰悜鍙互涓虹┖ + /// 缁堢偣涓嶆槸宸ヤ綔鍙版椂鎸夎鏁板�间綔涓轰换鍔$粓鐐规柟鍚� + /// </summary> + //public string podDir { get; set; } + + /// <summary> + /// 璐ф灦绫诲瀷, 浼犵┖鏃惰〃绀洪殢鏈烘壘涓揣鏋� 鎵剧┖璐ф灦浼犲弬鏂瑰紡濡備笅锛� + /// -1: 浠h〃涓嶅叧蹇冭揣鏋剁被鍨�, 鎵惧埌绌鸿揣鏋跺嵆鍙�. -2: 浠h〃浠庡伐浣滀綅鑾峰彇鍏宠仈璐ф灦绫诲瀷, + /// 濡傛灉鏈厤缃�, 鍙壘绌鸿揣鏋�. 璐ф灦绫诲瀷缂栧彿: 鍙壘璇ヨ揣鏋剁被鍨嬬殑绌鸿揣鏋�. + /// </summary> + //public string podTyp { get; set; } + + /// <summary> + /// 鐗╂枡鎵规鎴栬揣鏋朵笂鐨勭墿鏂欏敮涓�缂栫爜,鐢熸垚浠诲姟鍗曟椂,璐ф灦涓庣墿鏂欑洿鎺ョ粦瀹氭椂浣跨敤. + /// 锛堥�氳繃鍚屾椂浼爌odCode鍜宮aterialLot鏉ョ粦瀹氭垨閫氳繃 wbCode 鎵惧埌浣嶇疆涓婄殑璐ф灦鍜宮aterialLot鏉ョ粦瀹氾級 宸烽亾浠诲姟閫氳繃璇ュ瓧娈典紶鍏ョ壒寰佸�� + /// </summary> + //public string materialLot { get; set; } + + /// <summary> + /// 浼樺厛绾э紝浠庯紙1~127锛夌骇锛屾渶澶т紭鍏堢骇鏈�楂樸�備负绌烘椂锛岄噰鐢ㄤ换鍔℃ā鏉跨殑浼樺厛绾с�� + /// </summary> + public string priority { get; set;} + + /// <summary> + /// AGV缂栧彿锛屽~鍐欒〃绀烘寚瀹氭煇涓�缂栧彿鐨凙GV鎵ц璇ヤ换鍔� + /// </summary> + public string agvCode { get; set; } + + /// <summary> + /// 浠诲姟鍗曞彿,閫夊~, 涓嶅~绯荤粺鑷姩鐢熸垚锛孶UID灏忎簬绛変簬64浣� + /// </summary> + public string taskCode { get; set;} + + /// <summary> + /// 缁勭紪鍙凤紝 + /// 涓�鑸敤浜嶤TU鎸夌粍鍑哄簱锛屽悓缁勪换鍔′紭鍏堟嫾杞︺�� + /// 濡備笟鍔¢渶瑕佷换鍔$粍闂存垨缁勫唴鎸夐『搴忓嚭搴擄紝鍒欓渶璋冪敤CTU椤哄簭鍑哄簱鎺ュ彛銆� + /// </summary> + //public string groupId { get; set; } --2024骞�8鏈�27鏃� AGV鏂规洿鏂癛CS-Lite鐗堟湰 绉婚櫎姝ゅ瓧娈� + + /// <summary> + /// 鑷畾涔夊瓧娈�.JSON鏍煎紡 + /// </summary> + //public object data { get; set; } + } + + + /// <summary> + /// positionCodePath 鎵╁睍 + /// </summary> + public class position + { + /// <summary> + /// type:浣嶇疆绫诲瀷璇存槑: 00琛ㄧず锛氫綅缃紪鍙� 01琛ㄧず锛氱墿鏂欐壒娆″彿 02琛ㄧず锛氱瓥鐣ョ紪鍙凤紙鍚涓尯鍩燂級 + /// 濡傦細绗竴涓尯鍩熸斁涓嶄笅, 鍙互鏀剧浜屼釜鍖哄煙 03琛ㄧず锛氳揣鏋剁紪鍙凤紝閫氳繃璐ф灦缂栧彿鎵惧埌璐ф灦鎵�鍦ㄤ綅缃� 04琛ㄧず锛氬尯鍩熺紪鍙凤紝鍦ㄥ尯鍩熶腑鏌ユ壘鍙敤浣嶇疆 + /// 05琛ㄧず锛氫粨浣嶇紪鍙凤紙鍙夎溅/CTU涓撶敤锛� 06琛ㄧず锛氬贩閬撶紪鍙� 07 琛ㄧず锛氬鍣ㄧ紪鍙� 08 琛ㄧず锛氬贩閬撶瓥鐣� + /// 09 琛ㄧず锛氬贩閬撳尯鍩� 10 琛ㄧず锛氬贩閬撲粨浣� 11 琛ㄧず锛氳緭閫佺嚎锛堟満鍙帮級缂栧彿 12 琛ㄧず锛欳TU宸ヤ綔鍙帮紙瑁呭嵏鏈猴級缂栧彿 13琛ㄧず鎼繍宸烽亾鎸囧畾璐ф灦鍑哄簱 + /// </summary> + public string type { get; set; } = "05"; //姝ら」鐩粯璁や负5 + + /// <summary> + /// 鏍规嵁type濉啓锛屽懠鍙珯鐐�/鍖哄煙缂栧彿/绛栫暐缂栧彿绛� + /// </summary> + public string positionCode { get; set; } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Common/AGVInterface/Respon/AGVResponBase.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Common/AGVInterface/Respon/AGVResponBase.cs" new file mode 100644 index 0000000..8d0fd0c --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Common/AGVInterface/Respon/AGVResponBase.cs" @@ -0,0 +1,31 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WIDESEA_Comm +{ + public class AGVResponBase + { + /// <summary> + /// 鍝嶅簲浠g爜 0-鎴愬姛 + /// </summary> + public string code { get; set; } + + /// <summary> + /// 鍝嶅簲娑堟伅 + /// </summary> + public string message { get; set; } + + /// <summary> + /// 璇锋眰浠g爜 + /// </summary> + public string reqCode { get; set; } + + /// <summary> + /// 鍝嶅簲鏁版嵁 + /// </summary> + public object data { get; set; } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Common/AGVTask/agvTask.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Common/AGVTask/agvTask.cs" new file mode 100644 index 0000000..3d98aa2 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Common/AGVTask/agvTask.cs" @@ -0,0 +1,128 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WIDESEA_Comm.AGVTask +{ + public class agvTask + { + /// <summary> + /// 璇锋眰缂栧彿锛屾瘡涓姹傞兘瑕佷竴涓敮涓�缂栧彿锛� 鍚屼竴涓姹傞噸澶嶆彁浜わ紝 浣跨敤鍚屼竴缂栧彿 + /// </summary> + public string reqCode { get; set; } + + /// <summary> + /// 璇锋眰鏃堕棿鎴筹紝鏍煎紡: 鈥測yyy-MM-dd HH:mm:ss鈥� + /// </summary> + public string reqTime { get; set; } + + /// <summary> + /// 鍦扮爜 X 鍧愭爣(mm)锛氫换鍔″畬鎴愭椂鏈夊�� + /// </summary> + public string cooX { get; set; } + + /// <summary> + /// 鍦扮爜 Y 鍧愭爣(mm)锛氫换鍔″畬鎴愭椂鏈夊�� + /// </summary> + public string cooY { get; set; } + + /// <summary> + /// 褰撳墠浣嶇疆缂栧彿 + /// 浠诲姟寮�濮嬶細璇ヤ綅缃负浠诲姟璧风偣 + /// 璧板嚭鍌ㄤ綅锛氳浣嶇疆涓轰换鍔¤捣鐐� + /// 浠诲姟鍗曞彇娑堬細璇ヤ綅缃负宸ヤ綔浣嶇紪鍙� + /// 浠诲姟缁撴潫锛氳浣嶇疆涓轰换鍔$粓鐐� + /// 鍙栨斁鐢宠锛氬彇鏀炬枡绠辩殑鐐� + /// </summary> + public string currentPositionCode { get; set; } + + /// <summary> + /// 鑷畾涔夊瓧娈碉紝涓嶈秴杩�2000涓瓧绗� + /// </summary> + public string data { get; set; } + + /// <summary> + /// 鍦板浘缂栧彿 + /// </summary> + public string mapCode { get; set; } + + /// <summary> + /// 鍦扮爜缂栧彿锛氫换鍔″畬鎴愭椂鏈夊�� + /// </summary> + public string mapDataCode { get; set; } + + /// <summary> + /// 浠撲綅缂栧彿锛氬弶杞︿笌CTU浠诲姟鏃舵湁鍊� + /// </summary> + public string stgBinCode { get; set; } + + /// <summary> + /// 鏂规硶鍚�, 鍙娇鐢ㄤ换鍔$被鍨嬪仛涓烘柟娉曞悕鐢盧CS-2000浠诲姟妯℃澘閰嶇疆鍚庡苟鍛婄煡涓婂眰绯荤粺 + /// 榛樿浣跨敤鏂瑰紡: + /// start : 浠诲姟寮�濮� + /// outbin : 璧板嚭鍌ㄤ綅 + /// end : 浠诲姟缁撴潫 + /// cancel : 浠诲姟鍗曞彇娑� + /// apply锛欳TU鏂欑鍙栨斁鐢宠 + /// </summary> + public string method { get; set; } + + /// <summary> + /// 璐ф灦缂栧彿锛氳儗璐ф灦鏃舵湁鍊� + /// </summary> + public string podCode { get; set; } + + /// <summary> + /// 180鈥�,鈥�0鈥�,鈥�90鈥�,鈥�-90鈥� 鍒嗗埆瀵瑰簲鍦板浘鐨勨�濆乏鈥�,鈥濆彸鈥�,鈥濅笂鈥�,鈥濅笅鈥濓細浠诲姟瀹屾垚鏃舵湁鍊� + /// </summary> + public string podDir { get; set; } + + /// <summary> + /// 鐗╂枡缂栧彿 + /// </summary> + public string materialLot { get; set; } + + /// <summary> + /// AGV缂栧彿锛堝悓 agvCode 锛� + /// </summary> + public string robotCode { get; set; } + + /// <summary> + /// 褰撳墠浠诲姟鍗曞彿 + /// </summary> + public string taskCode { get; set; } + + /// <summary> + /// 宸ヤ綔浣嶏紝涓嶳CS-2000绔厤缃殑浣嶇疆鍚嶇О涓�鑷淬�備换鍔″畬鎴愭椂鏈夊�硷紝涓庣敓鎴愪换鍔″崟鎺ュ彛涓殑wbCode涓�鑷淬�� + /// </summary> + public string wbCode { get; set; } + + /// <summary> + /// 瀹瑰櫒缂栧彿 + /// </summary> + public string ctnrCode { get; set; } + + /// <summary> + /// 瀹瑰櫒绫诲瀷 + /// </summary> + public string ctnrType { get; set; } + + /// <summary> + /// 宸烽亾缂栧彿 + /// </summary> + public string roadWayCode { get; set; } + + /// <summary> + /// 宸烽亾鍐呴『搴忓彿 + /// 宸烽亾灏炬槸0锛屽埌宸烽亾澶翠緷娆¢�掑1 + /// </summary> + public string seq { get; set; } + + /// <summary> + /// 璁惧缂栧彿锛屽姊抽娇寮忓伐浣滅珯銆佽緭閫佺嚎绛夛紝涓�鑸娇鐢ㄤ簬CTU鍦烘櫙銆傜郴缁熸牴鎹粨浣嶅畾浣嶅埌鍏宠仈鐨勮澶囩紪鍙枫�� + /// </summary> + public string eqpCode { get; set; } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Common/CheckEquip/CheckInfo.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Common/CheckEquip/CheckInfo.cs" new file mode 100644 index 0000000..5bdbd6d --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Common/CheckEquip/CheckInfo.cs" @@ -0,0 +1,59 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WIDESEA_Common +{ + + public class RequsetMsg + { + public string CLTM { get; set; } + } + + public class CheckInfo + { + /// <summary> + /// 缂栧彿 + /// </summary> + public string CLTM { get; set; } + + /// <summary> + /// 娴嬮噺宸ヤ欢绫诲瀷 + /// 1-杞﹁疆 + /// 2-鍒跺姩鐩� + /// </summary> + public string CheckType { get; set; } + + /// <summary> + /// 杞﹀瀷 + /// </summary> + public string CarType { get; set; } + + /// <summary> + /// 娴嬮噺鏍囧噯(鏂�/鏃�) 1锛氭棫 0 锛氭柊 + /// </summary> + public string Standards { get; set; } + + /// <summary> + /// 鍒堕�犲崟浣� + /// </summary> + public string MadeUnit { get; set; } + + /// <summary> + /// 姣傚瓟绛夌骇 + /// </summary> + public string HubLevel { get; set; } + + /// <summary> + /// 鏄惁娴嬮噺 + /// </summary> + public bool IsCheck { get; set; } + + /// <summary> + /// 鍔ㄦ嫋灞炴�� M-鍔� T-鎷� + /// </summary> + public string MTType { get; set; } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Common/CheckEquip/CheckResult.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Common/CheckEquip/CheckResult.cs" new file mode 100644 index 0000000..ee09f22 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Common/CheckEquip/CheckResult.cs" @@ -0,0 +1,112 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WIDESEA_Common +{ + public class CheckResult + { + /// <summary> + /// 璁惧缂栧彿 + /// </summary> + public string EquipNo { get; set; } + /// <summary> + /// 缂栧彿 + /// </summary> + public string CLTM { get; set; } + + /// <summary> + /// 娴嬮噺绫诲瀷(杞﹁疆/鍒跺姩鐩�) + /// </summary> + public string CheckType { get; set; } + + /// <summary> + /// 杞�/鐩樻瘋瀛旂洿寰処1 + /// </summary> + public string gkzjI1 { get; set; } + /// <summary> + /// 杞�/鐩樻瘋瀛旂洿寰処2 + /// </summary> + public string gkzjI2 { get; set; } + /// <summary> + /// 杞�/鐩樻瘋瀛旂洿寰処3 + /// </summary> + public string gkzjI3 { get; set; } + /// <summary> + /// 杞�/鐩樻瘋瀛旂洿寰処骞冲潎鍊� + /// </summary> + public string gkzjIAvg { get; set; } + /// <summary> + /// 杞�/鐩樻瘋瀛旂洿寰処鍦嗗害 + /// </summary> + public string gkzjICir { get; set; } + + /// <summary> + /// 杞�/鐩樻瘋瀛旂洿寰処I1 + /// </summary> + public string gkzjII1 { get; set; } + /// <summary> + /// 杞�/鐩樻瘋瀛旂洿寰処I2 + /// </summary> + public string gkzjII2 { get; set; } + /// <summary> + /// 杞�/鐩樻瘋瀛旂洿寰処I3 + /// </summary> + public string gkzjII3 { get; set; } + /// <summary> + /// 杞�/鐩樻瘋瀛旂洿寰処I骞冲潎鍊� + /// </summary> + public string gkzjIIAvg { get; set; } + /// <summary> + /// 杞�/鐩樻瘋瀛旂洿寰処I鍦嗗害 + /// </summary> + public string gkzjIICir { get; set; } + + //CRH1銆丆RH2A(缁�)銆丆RH380A(L) + //CRH6A杞﹀瀷鍒跺姩鐩樻祴閲忎笁涓埅闈紝鍏朵綑鎶�鏈崗璁腑闄愬畾杞﹀瀷鍒跺姩鐩樻祴閲忎袱涓埅闈€�傛墍鏈夎溅杞疆姣傚瓟閮芥祴閲忎笁涓埅闈� + + /// <summary> + /// 杞�/鐩樻瘋瀛旂洿寰処II1 鍙┖ + /// </summary> + public string gkzjIII1 { get; set; } + /// <summary> + /// 杞�/鐩樻瘋瀛旂洿寰処II2 鍙┖ + /// </summary> + public string gkzjIII2 { get; set; } + /// <summary> + /// 杞�/鐩樻瘋瀛旂洿寰処II3 鍙┖ + /// </summary> + public string gkzjIII3 { get; set; } + /// <summary> + /// 杞�/鐩樻瘋瀛旂洿寰処II骞冲潎鍊� 鍙┖ + /// </summary> + public string gkzjIIIAvg { get; set; } + /// <summary> + /// 杞�/鐩樻瘋瀛旂洿寰処II鍦嗗害 鍙┖ + /// </summary> + public string gkzjIIICir { get; set; } + + /// <summary> + /// 杞�/鐩樻瘋瀛旂洿寰勫钩鍧囧�� 鍙┖ + /// </summary> + public string gkzjAVG { get; set; } + + /// <summary> + /// 杞�/鐩樻瘋瀛旂洿寰勫渾鏌卞害 + /// </summary> + public string gkzjCir { get; set; } + + /// <summary> + /// 鏄惁鍚堟牸 1-鍚堟牸 2-涓嶅悎鏍� + /// </summary> + public int Result { get; set; } + + /// <summary> + /// 鍏ュ簱鏃堕棿 鍙┖ + /// </summary> + public string InDate { get; set; } + + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Common/DetailMessage/TaskDescription.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Common/DetailMessage/TaskDescription.cs" new file mode 100644 index 0000000..360a5b4 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Common/DetailMessage/TaskDescription.cs" @@ -0,0 +1,31 @@ +锘縰sing System.Net; + +namespace WIDESEA_Common +{ + public class TaskDescription + { + /// <summary> + /// 鑾峰彇浠诲姟鏇存柊鎻忚堪 + /// </summary> + /// <param name="currentAddress">褰撳墠鍦板潃</param> + /// <param name="newPosition">鏂颁綅缃�</param> + /// <param name="statusDescription">鐘舵�佹弿杩�</param> + /// <returns>浠诲姟鏇存柊鎻忚堪瀛楃涓�</returns> + public static string GetTaskUpdateDescription(string palletCode, string currentAddress, string newPosition, string statusDescription) + { + return $"浠诲姟鏇存柊->鎵樼洏銆恵palletCode}銆戣揣鐗╀綅缃粠銆恵currentAddress}銆戠Щ鍔ㄨ嚦銆恵newPosition}銆�--{statusDescription}"; + } + + /// <summary> + /// 鑾峰彇浠诲姟鏇存柊鎻忚堪 + /// </summary> + /// <param name="currentAddress">褰撳墠鍦板潃</param> + /// <param name="newPosition">鏂颁綅缃�</param> + /// <param name="statusDescription">鐘舵�佹弿杩�</param> + /// <returns>浠诲姟鏇存柊鎻忚堪瀛楃涓�</returns> + public static string GetTaskInsertDescription(string palletCode, string currentAddress, string newPosition, string statusDescription) + { + return $"浠诲姟娣诲姞->鎵樼洏銆恵palletCode}銆戣揣鐗╀粠銆恵currentAddress}銆戝叆搴撶敵璇峰垎閰嶅贩閬撱�恵newPosition}銆�--{statusDescription}"; + } + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Common/HttpClient/HttpsClient.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Common/HttpClient/HttpsClient.cs" new file mode 100644 index 0000000..0b61952 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Common/HttpClient/HttpsClient.cs" @@ -0,0 +1,296 @@ +锘縰sing LogLibrary.Log; +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.RegularExpressions; +using System.Threading.Tasks; +using System.Xml; +using WIDESEA.Common; +using WIDESEA_Common.ZY; +using Formatting = System.Xml.Formatting; + +namespace WIDESEA_Common; + +public class HttpsClient +{ + private static readonly LogFactory LogFactory = new LogFactory(); + + // 灏佽涓�涓敤HttpClient鍙戦�丟ET璇锋眰鐨勬柟娉曟湁鍙傛暟 + public static async Task<string> GetAsync(string url, Dictionary<string, object> parameters) + { + // 璁板綍璇锋眰鍙傛暟 + LogRequestParameters(parameters, url); + + // 灏嗗弬鏁版嫾鎺ュ埌URL涓� + string queryString = string.Join("&", parameters.Select(x => $"{x.Key}={x.Value}")); + url += "?" + queryString; + + // 鍒涘缓HttpClient瀹炰緥 + using (HttpClient client = new HttpClient()) + { + // 鍙戦�丟ET璇锋眰骞惰幏鍙栧搷搴� + HttpResponseMessage response = await client.GetAsync(url); + + // 纭繚鍝嶅簲鎴愬姛 + response.EnsureSuccessStatusCode(); + + // 璇诲彇鍝嶅簲鍐呭 + string responseBody = await response.Content.ReadAsStringAsync(); + + // 璁板綍鍝嶅簲鍙傛暟 + LogResponseParameters(responseBody, url); + + // 杩斿洖鍝嶅簲鍐呭 + return responseBody; + } + } + + // 鐢ㄤ簬杩借釜姣忎釜璇锋眰鐨勮皟鐢ㄦ鏁板拰鏈�鍚庤姹傛椂闂淬�� + private static readonly Dictionary<string, (int Count, DateTime LastRequestTime)> requestTracker = new(); + // 灏佽涓�涓敤HttpClient鍙戦�丳ost璇锋眰鐨勬柟娉曟湁鍙傛暟 + public static async Task<string> PostAsync(string url, Dictionary<string, object> parameters) + { + // 鍒涘缓涓�涓柊鐨勫瓧鍏革紝鎺掗櫎 RequestTime 鍜� SessionId + var filteredParameters = parameters.Where(p => p.Key != "RequestTime" && p.Key != "SessionId").ToDictionary(p => p.Key, p => p.Value); + + string requestKey = $"{url}:{JsonConvert.SerializeObject(filteredParameters)}"; + // 妫�鏌ヨ姹傛鏁板拰鏃堕棿闄愬埗 + if (requestTracker.TryGetValue(requestKey, out var requestInfo)) + { + if (requestInfo.Count >= 5 && DateTime.Now < requestInfo.LastRequestTime.AddMinutes(10)) + { + // 濡傛灉璇锋眰娆℃暟瓒呰繃闄愬埗涓旀湭瓒呰繃10鍒嗛挓锛屾姏鍑哄紓甯� + throw new InvalidOperationException("璇锋眰娆℃暟宸茶揪鍒伴檺鍒讹紝璇风◢鍚庡啀璇曘��"); + } + } + + // 鏇存柊璇锋眰璺熻釜淇℃伅 + if (requestTracker.ContainsKey(requestKey)) + { + requestTracker[requestKey] = (requestInfo.Count + 1, DateTime.Now); + } + else + { + requestTracker[requestKey] = (1, DateTime.Now); + } + + + // 璁板綍璇锋眰鍙傛暟 + LogRequestParameters(parameters, url); + + // 鍒涘缓HttpClient瀹炰緥 + using (HttpClient client = new HttpClient()) + { + // 灏嗗弬鏁拌浆鎹负FormUrlEncodedContent + //string content = JsonConvert.SerializeObject(parameters); + var content = new FormUrlEncodedContent(ConvertToKeyValuePairs(parameters)); + + //client.Timeout = TimeSpan.from; + + var request = new HttpRequestMessage(HttpMethod.Post, url); + request.Content = content; + + //request.Content = new StringContent(content, Encoding.UTF8, "application/json"); + + //// 鍙戦�丳OST璇锋眰骞惰幏鍙栧搷搴� + //HttpResponseMessage response = await client.PostAsync(url, content); + HttpResponseMessage response = await client.SendAsync(request); + + // 纭繚鍝嶅簲鎴愬姛 + response.EnsureSuccessStatusCode(); + + // 璇诲彇鍝嶅簲鍐呭 + string responseBody = await response.Content.ReadAsStringAsync(); + + // 璁板綍鍝嶅簲鍙傛暟 + LogResponseParameters(responseBody, url); + + // 杩斿洖鍝嶅簲鍐呭 + return responseBody; + } + } + + // 灏佽涓�涓敤HttpClient鍙戦�丳ost璇锋眰鐨勬柟娉曟湁鍙傛暟 + public static string Post(string url) + { + // 璁板綍璇锋眰鍙傛暟 + //LogRequestParameters(null, url); + + // 鍒涘缓HttpClient瀹炰緥 + using (HttpClient client = new HttpClient()) + { + // 灏嗗弬鏁拌浆鎹负FormUrlEncodedContent + //string content = JsonConvert.SerializeObject(parameters); + //var content = new FormUrlEncodedContent(ConvertToKeyValuePairs(parameters)); + + //client.Timeout = TimeSpan.from; + + var request = new HttpRequestMessage(HttpMethod.Post, url); + //request.Content = content; + + //request.Content = new StringContent(content, Encoding.UTF8, "application/json"); + + //// 鍙戦�丳OST璇锋眰骞惰幏鍙栧搷搴� + //HttpResponseMessage response = await client.PostAsync(url, content); + HttpResponseMessage response = client.Send(request); + + // 纭繚鍝嶅簲鎴愬姛 + response.EnsureSuccessStatusCode(); + // 璇诲彇鍝嶅簲鍐呭 + Stream stream = response.Content.ReadAsStream(); + StreamReader streamReader = new StreamReader(stream); + string webResponse = streamReader.ReadToEnd(); + + // 璁板綍鍝嶅簲鍙傛暟 + LogResponseParameters(webResponse, url); + + // 杩斿洖鍝嶅簲鍐呭 + return webResponse; + } + } + + public static string PostXml(string url, Dictionary<string, object> parameters) + { + // 璁板綍璇锋眰鍙傛暟 + LogRequestParameters(parameters, url); + + // 鍒涘缓HttpClient瀹炰緥 + using (HttpClient client = new HttpClient()) + { + // 灏嗗弬鏁拌浆鎹负FormUrlEncodedContent + //string content = JsonConvert.SerializeObject(parameters); + var content = new FormUrlEncodedContent(ConvertToKeyValuePairs(parameters)); + + //鍗佺瓒呮椂 + client.Timeout = new TimeSpan(0, 0, 10); + + var request = new HttpRequestMessage(HttpMethod.Post, url); + request.Content = content; + + //request.Content = new StringContent(content, Encoding.UTF8, "application/json"); + + //// 鍙戦�丳OST璇锋眰骞惰幏鍙栧搷搴� + //HttpResponseMessage response = await client.PostAsync(url, content); + HttpResponseMessage response = client.Send(request); + + // 纭繚鍝嶅簲鎴愬姛 + response.EnsureSuccessStatusCode(); + //string xmlContent = await response.Content.ReadAsStringAsync(); + + // 璇诲彇鍝嶅簲鍐呭 + Stream stream = response.Content.ReadAsStream(); + StreamReader streamReader = new StreamReader(stream); + string respon = streamReader.ReadToEnd(); + + //string webResponse = XmlToJson(respon); + + string webResponse = ReplaceXmlStyle(respon); + + // 璇诲彇鍝嶅簲鍐呭 + //Stream stream = response.Content.ReadAsStream(); + //StreamReader streamReader = new StreamReader(stream); + //string webResponse = streamReader.ReadToEnd(); + + // 璁板綍鍝嶅簲鍙傛暟 + LogResponseParameters(webResponse, url); + + // 杩斿洖鍝嶅簲鍐呭 + return webResponse; + } + } + + static string XmlToJson(string xmlContent) + { + // 鎻愬彇鍐呭眰 XML 鍐呭 + int startIndex = xmlContent.IndexOf("<?xml"); + string innerXml = xmlContent.Substring(startIndex); + // 鍘婚櫎澶栧眰澶氫綑鐨勫唴瀹癸紙鍋囪澶栧眰鍙湁 <string> 鐩稿叧鍐呭锛� + innerXml = Regex.Replace(innerXml, @"^.*?<ROOT>", "<ROOT>"); + + // 鍘婚櫎鍐呭眰 XML 澹版槑 + innerXml = innerXml.Replace("<?xml version=\"1.0\" encoding=\"utf-8\"?>", ""); + innerXml = innerXml.Replace("<string xmlns=\"http://tempuri.org/\">", ""); + + innerXml = innerXml.Replace("<?xml version=\"1.0\" encoding=\"GB2312\"?>", ""); + // 澶勭悊杞箟瀛楃 + innerXml = innerXml.Replace("<", "<"); + innerXml = innerXml.Replace(">", ">"); + innerXml = innerXml.Replace("</string>", ""); + + innerXml = innerXml.Replace("<?xml version=\"1.0\" encoding=\"GB2312\"?>", ""); + + //innerXml = innerXml.Replace("<ROOT>", ""); + //innerXml = innerXml.Replace("</ROOT>", ""); + + XmlDocument xmlDoc = new XmlDocument(); + xmlDoc.LoadXml(innerXml); + + // 灏哫ML杞崲涓篔SON + string json = JsonConvert.SerializeXmlNode(xmlDoc); + + return json; + } + + static string ReplaceXmlStyle(string xmlContent) + { + // 鎻愬彇鍐呭眰 XML 鍐呭 + int startIndex = xmlContent.IndexOf("<?xml"); + string innerXml = xmlContent.Substring(startIndex); + // 鍘婚櫎澶栧眰澶氫綑鐨勫唴瀹癸紙鍋囪澶栧眰鍙湁 <string> 鐩稿叧鍐呭锛� + innerXml = Regex.Replace(innerXml, @"^.*?<ROOT>", "<ROOT>"); + + // 鍘婚櫎鍐呭眰 XML 澹版槑 + innerXml = innerXml.Replace("<?xml version=\"1.0\" encoding=\"utf-8\"?>", ""); + innerXml = innerXml.Replace("<string xmlns=\"http://tempuri.org/\">", ""); + + innerXml = innerXml.Replace("<?xml version=\"1.0\" encoding=\"GB2312\"?>", ""); + // 澶勭悊杞箟瀛楃 + innerXml = innerXml.Replace("<", "<"); + innerXml = innerXml.Replace(">", ">"); + innerXml = innerXml.Replace("</string>", ""); + + innerXml = innerXml.Replace("<?xml version=\"1.0\" encoding=\"GB2312\"?>", ""); + + //innerXml = innerXml.Replace("<ROOT>", ""); + //innerXml = innerXml.Replace("</ROOT>", ""); + + XmlDocument xmlDoc = new XmlDocument(); + xmlDoc.LoadXml(innerXml); + + return xmlDoc.InnerXml; + //return xmlContent; + } + + + private static void LogRequestParameters(Dictionary<string, object> parameters, string url = "") + { + StringBuilder builder = new StringBuilder(); + builder.Append(Environment.NewLine); + builder.Append("---------------------------------------------"); + builder.Append(Environment.NewLine); + builder.Append("url:" + url + "璇锋眰鍙傛暟: " + JsonConvert.SerializeObject(parameters)); + LogFactory.GetLog("API鎺ュ彛").Info(true, builder); + } + + private static void LogResponseParameters(string responseBody, string url = "") + { + StringBuilder builder = new StringBuilder(); + builder.Append(Environment.NewLine); + builder.Append("url:" + url + "鍝嶅簲鍙傛暟: " + responseBody); + builder.Append(Environment.NewLine); + builder.Append("---------------------------------------------"); + builder.Append(Environment.NewLine); + LogFactory.GetLog("API鎺ュ彛").Info(true, builder); + } + + private static IEnumerable<KeyValuePair<string, string>> ConvertToKeyValuePairs(Dictionary<string, object> parameters) + { + foreach (var kvp in parameters) + { + yield return new KeyValuePair<string, string>(kvp.Key, kvp.Value?.ToString()); + } + } + +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Common/LevelChange/CheckTaskChangeHelper.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Common/LevelChange/CheckTaskChangeHelper.cs" new file mode 100644 index 0000000..6b08cf7 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Common/LevelChange/CheckTaskChangeHelper.cs" @@ -0,0 +1,34 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WIDESEA_Common.LevelChange +{ + public class CheckTaskChangeHelper + { + /// <summary> + /// 缁翠慨浠诲姟杞崲杞柊鏃� + /// </summary> + /// <param name="wxrw">缁翠慨浠诲姟</param> + /// <returns>閫夐厤杞柊鏃�(0-鏂� 1-鏃�)</returns> + public static string CheckTaskChange(string wxrw) + { + string wheelsNewOld = string.Empty; + if (wxrw.Contains("鍥涚骇淇�") || wxrw.Contains("浜旂骇淇�")) + { + wheelsNewOld = "1"; + } + if ((wxrw.Contains("鍥涚骇淇�") || wxrw.Contains("浜旂骇淇�")) && wxrw.Contains("鎹㈣疆(鏂�)")) + { + wheelsNewOld = "0"; + } + if (wxrw.Contains("涓夌骇淇�") && (wxrw.Contains("鎹㈣疆(鏂�)") || wxrw.Contains("鎹㈣疆缁勬垚(鏂�)"))) + wheelsNewOld = "0"; + if (wxrw.Contains("涓夌骇淇�") && (wxrw.Contains("鎹㈣疆(鏃�)") || wxrw.Contains("鎹㈣疆缁勬垚(鏃�)"))) + wheelsNewOld = "1"; + return wheelsNewOld; + } + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Common/LevelChange/LevelChangeHelper.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Common/LevelChange/LevelChangeHelper.cs" new file mode 100644 index 0000000..35854ce --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Common/LevelChange/LevelChangeHelper.cs" @@ -0,0 +1,58 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WIDESEA_Common +{ + public class LevelChangeHelper + { + public static string LevelChange(string beforeLevel) + { + string afterLevel = string.Empty; + switch (beforeLevel) + { + case "鍘熺骇": + afterLevel = "鏂伴�犲師鍨�"; break; + case "绛夌骇1": + afterLevel = "鏂伴�犲師鍨�1"; break; + case "绛夌骇2": + afterLevel = "鏂伴�犲師鍨�2"; break; + case "绛夌骇3": + afterLevel = "鏂伴�犲師鍨�3"; break; + case "绛夌骇4": + afterLevel = "鏂伴�犲師鍨�4"; break; + case "绛夌骇5": + afterLevel = "鏂伴�犲師鍨�5"; break; + case "绛夌骇6": + afterLevel = "鏂伴�犲師鍨�6"; break; + default: + afterLevel = ""; + break; + } + return afterLevel; + } + + public static string LevelChangeType(string beforeLevel) + { + string afterLevel = string.Empty; + + if (beforeLevel.Contains("鍘�")) + afterLevel = "鍘熺骇"; + if (beforeLevel.Contains("绛夌骇1")) + afterLevel = "绛夌骇1"; + if (beforeLevel.Contains("绛夌骇2")) + afterLevel = "绛夌骇2"; + if (beforeLevel.Contains("绛夌骇3")) + afterLevel = "绛夌骇3"; + if (beforeLevel.Contains("绛夌骇4")) + afterLevel = "绛夌骇4"; + if (beforeLevel.Contains("绛夌骇5")) + afterLevel = "绛夌骇5"; + if (beforeLevel.Contains("绛夌骇6")) + afterLevel = "绛夌骇6"; + return afterLevel; + } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Common/StationManager/StationManager.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Common/StationManager/StationManager.cs" new file mode 100644 index 0000000..38f95f3 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Common/StationManager/StationManager.cs" @@ -0,0 +1,62 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Text; + +namespace WIDESEA_Common +{ + /// <summary> + /// 绔欏彴绠$悊 + /// </summary> + public enum StationManager + { + /// <summary> + /// 鍏ュ簱鍙� + /// </summary> + Inbound = 1, + + /// <summary> + /// 鍑哄簱鍙� + /// </summary> + Outbound, + + /// <summary> + /// 鍒嗗鍑哄簱娈碉紙寮傚父鎺掑嚭鍙o級 + /// </summary> + AbnormalOutStation, //鍒嗗鍑哄簱娈碉紙寮傚父鎺掑嚭鍙o級 + + /// <summary> + /// NG宸ョ珯鏀炬枡鍙� + /// </summary> + NGPutStation, + + /// <summary> + /// NG宸ョ珯鍙栨枡鍙� + /// </summary> + NGTakeStation, + + /// <summary> + /// 绌烘鍏ュ簱鍙� + /// </summary> + EmptyInbound, + + /// <summary> + /// 绌烘鍑哄簱鍙� + /// </summary> + EmptyOutbound, + + + + + /// <summary> + /// 寮傚父鎺掑嚭鍙�(鍏ュ簱娈�) --鍒嗗鍏ュ簱娈� + /// </summary> + AbnormalInStation = 15, + + /// <summary> + /// 娑堥槻绔欏彴 + /// </summary> + FireStation = 100, + + + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Common/StatusChangeType/StatusChangeTypeEnum.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Common/StatusChangeType/StatusChangeTypeEnum.cs" new file mode 100644 index 0000000..8bfdf7a --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Common/StatusChangeType/StatusChangeTypeEnum.cs" @@ -0,0 +1,25 @@ +锘縰sing System.ComponentModel; + +namespace WIDESEA_Common +{ + public enum StatusChangeTypeEnum + { + /// <summary> + /// 鑷姩鍏ュ簱 + /// </summary> + [Description("鑷姩鍏ュ簱")] + AutomaticStorage = 1, + + /// <summary> + /// 鑷姩鍑哄簱 + /// </summary> + [Description("鑷姩鍑哄簱")] + AutomaticDelivery = 2, + + /// <summary> + /// 浜哄伐鎿嶄綔 + /// </summary> + [Description("浜哄伐鎿嶄綔")] + ManualOperation = 3 + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Common/SysConst/TaskConst.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Common/SysConst/TaskConst.cs" new file mode 100644 index 0000000..84a7bbf --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Common/SysConst/TaskConst.cs" @@ -0,0 +1,13 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WIDESEA_Common +{ + public class TaskConst + { + + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Common/SysConst/operationType.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Common/SysConst/operationType.cs" new file mode 100644 index 0000000..234c6f2 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Common/SysConst/operationType.cs" @@ -0,0 +1,13 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WIDESEA_Common +{ + public enum operationType + { + + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Common/XmlTool/XMLSerializationTool.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Common/XmlTool/XMLSerializationTool.cs" new file mode 100644 index 0000000..31bcf64 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Common/XmlTool/XMLSerializationTool.cs" @@ -0,0 +1,137 @@ +锘縰sing Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Reflection.PortableExecutable; +using System.Text; +using System.Threading.Tasks; +using System.Xml; +using System.Xml.Linq; +using System.Xml.Serialization; + +namespace WIDESEA.Common +{ + public class XMLSerializationTool + { + /// <summary> + /// 鍙戝簭鍒楀寲鎴愬璞� + /// </summary> + /// <param name="type"></param> + /// <param name="xml"></param> + /// <returns></returns> + + public static T DeserializeXmlToObject<T>(string receiveXml) + { + using (StreamReader reader = new StreamReader( + new MemoryStream( + Encoding.UTF8.GetBytes(receiveXml)), + Encoding.Default)) + { + try + { + XmlSerializer serializer = new XmlSerializer(typeof(T)); + T rel = (T)serializer.Deserialize(reader); + return rel; + } + finally { reader.Close(); } + } + } + + //public static T DeserializeXmlToObjectBySub<T>(string receiveXml) + //{ + // //XDocument document = XDocument.Load(receiveXml); + + // //var jsondata = document.Descendants().Where(x => x.Name == "string" && x.Value.StartsWith("{") && x.Value.EndsWith("}")).First().Value; + + // //receiveXml.Where(x => ); + + // //T json = JsonConvert.DeserializeObject<T>(jsondata); + + // //return json; + // //T rel = (T)serializer.Deserialize(reader); + + //} + + /// <summary> + /// 搴忓垪鍖栨垚xml鏂囦欢鏍煎紡 + /// </summary> + /// <typeparam name="T"></typeparam> + /// <param name="obj"></param> + /// <returns></returns> + public static string SerializeObjectToXml<T>(T obj) + { + string rel = string.Empty; + + using (MemoryStream ms = new MemoryStream()) + { + try + { + //鍘绘帀榛樿鐨� xmlns鏍囩 + XmlSerializerNamespaces ns = new XmlSerializerNamespaces(); + ns.Add("", ""); + + StreamWriter sw = new StreamWriter(ms); + //璁剧疆UTF-8 + XmlWriterSettings settings = new XmlWriterSettings(); + settings.Encoding = Encoding.UTF8; + settings.Indent = true; + using (XmlWriter writer = XmlWriter.Create(sw, settings)) + { + XmlSerializer serializer = new XmlSerializer(typeof(T)); + serializer.Serialize(writer, obj, ns); + writer.Flush(); + writer.Close(); + } + using (StreamReader sr = new StreamReader(ms)) + { + ms.Position = 0; + rel = sr.ReadToEnd(); + sr.Close(); + } + } + finally + { + ms.Close(); + } + } + + ////璁剧疆UTF-8 + //XmlWriterSettings xws = new XmlWriterSettings(); + //xws.Encoding = Encoding.UTF8; + //StringBuilder sb = new StringBuilder(); + //XmlWriter xw = XmlWriter.Create(sb, xws); + + + //XmlSerializer xs = new XmlSerializer(typeof(T)); + //xs.Serialize(xw, obj, ns); + //xw.Close(); + return rel; + } + + + //public static string SerializeObjectToXml<T>(T obj) + //{ + // string rel = string.Empty; + // using (MemoryStream storedStream = new MemoryStream()) + // { + // try + // { + // //鍘绘帀榛樿鐨� xmlns鏍囩 + // XmlSerializerNamespaces ns = new XmlSerializerNamespaces(); + // ns.Add("", ""); + + // new XmlSerializer(typeof(T)).Serialize(storedStream, obj, ns); + // storedStream.Position = 0; + // using (StreamReader reader = new StreamReader(storedStream, Encoding.UTF8)) + // { + // try { rel = reader.ReadToEnd(); } + // finally { reader.Close(); } + // } + // } + // finally { storedStream.Close(); } + // } + // return rel; + //} + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Common/ZY/Basic_ZY.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Common/ZY/Basic_ZY.cs" new file mode 100644 index 0000000..15e650c --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Common/ZY/Basic_ZY.cs" @@ -0,0 +1,25 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Xml.Serialization; + +namespace WIDESEA_Common +{ + [XmlRoot("ROOT")] + public class Basic_ZY + { + /// <summary> + /// 鏍囪瘑 + /// </summary> + [XmlElement] + public string FLAG { get; set; } + + /// <summary> + /// 閿欒淇℃伅 + /// </summary> + [XmlElement] + public string ERROR { get; set; } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Common/ZY/CLInfo_ZY.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Common/ZY/CLInfo_ZY.cs" new file mode 100644 index 0000000..89a6724 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Common/ZY/CLInfo_ZY.cs" @@ -0,0 +1,139 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Xml.Serialization; + +namespace WIDESEA_Common.ZY +{ + [XmlRoot("ROOT")] + public class CLInfo_ZY : Basic_ZY + { + // /// <summary> + // /// 鏍囪瘑 + // /// </summary> + // [XmlElement] + // public string FLAG { get; set; } + + // /// <summary> + // /// 閿欒淇℃伅 + // /// </summary> + // [XmlElement] + // public string ERROR { get; set; } + + /// <summary> + /// 杞﹁疆鏉$爜 + /// </summary> + [XmlElement] + public string CLH { get; set; } + + /// <summary> + /// 杞鏉$爜 + /// </summary> + [XmlElement] + public string LDTM { get; set; } + + /// <summary> + /// 杞﹀瀷 + /// </summary> + [XmlElement] + public string CHEXING { get; set; } + + /// <summary> + /// 杞︾粍鍙� + /// </summary> + [XmlElement] + public string LCCH { get; set; } + + /// <summary> + /// 杞鍙� + /// </summary> + [XmlElement] + public string LDH { get; set; } + + /// <summary> + /// 杞鍨嬪彿 + /// </summary> + [XmlElement] + public string LDXH { get; set; } + + /// <summary> + /// 鍔ㄦ嫋灞炴�� M锛氬姩,T锛氭嫋 M/T锛氬姩鎷栭�氱敤 + /// </summary> + [XmlElement] + public string MTTYPE { get; set; } + + /// <summary> + /// 鏂版棫灞炴�� 1锛氭棫 0 锛氭柊 + /// </summary> + [XmlElement] + public string NEWOLD { get; set; } + + /// <summary> + /// 杞﹁疆灞炴�� + /// </summary> + [XmlElement] + public string CLSX { get; set; } + + /// <summary> + /// 姣傚瓟绛夌骇 + /// </summary> + [XmlElement] + public string GKDJ { get; set; } + + /// <summary> + /// 姣傚瓟a鐣岄潰鍧囧�� + /// </summary> + [XmlElement] + public string GKZJA { get; set; } + + /// <summary> + /// 姣傚瓟b鐣岄潰鍧囧�� + /// </summary> + [XmlElement] + public string GKZJB { get; set; } + + /// <summary> + /// 姣傚瓟c鐣岄潰鍧囧�� + /// </summary> + [XmlElement] + public string GKZJC { get; set; } + + /// <summary> + /// 閰嶅睘灞� + /// </summary> + [XmlElement] + public string PSJ { get; set; } + + /// <summary> + /// 姣傚瓟鍧囧�� + /// </summary> + [XmlElement] + public string gkcc { get; set; } + + /// <summary> + /// 杞緞鍊� + /// </summary> + [XmlElement] + public string LJZ { get; set; } + + /// <summary> + /// 棰勪及杞緞鍊� + /// </summary> + [XmlElement] + public string YGLJ { get; set; } + + /// <summary> + /// 鍏ュ簱鏃堕棿 + /// </summary> + [XmlElement] + public string RKSJ { get; set; } + + /// <summary> + /// 杞紭 + /// </summary> + [XmlElement] + public string LYH { get; set; } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Common/ZY/CZInfo_ZY.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Common/ZY/CZInfo_ZY.cs" new file mode 100644 index 0000000..b990ece --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Common/ZY/CZInfo_ZY.cs" @@ -0,0 +1,234 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Xml.Serialization; + +namespace WIDESEA_Common.ZY +{ + /// <summary> + /// 杞﹁酱淇℃伅 + /// </summary> + [XmlRoot("ROOT")] + public class CZInfo_ZY : Basic_ZY + { + + + ///// <summary> + ///// 鏍囪瘑 + ///// </summary> + //[XmlElement] + //public string FLAG { get; set; } + + ///// <summary> + ///// 閿欒淇℃伅 + ///// </summary> + //[XmlElement] + //public string ERROR { get; set; } + + /// <summary> + /// 杞﹁酱鏉$爜 + /// </summary> + [XmlElement] + public string CZH { get; set; } + + /// <summary> + /// 杞鏉$爜 + /// </summary> + [XmlElement] + public string LDTM { get; set; } + + /// <summary> + /// 杞﹀瀷 + /// </summary> + [XmlElement] + public string CHEXING { get; set; } + + /// <summary> + /// 杞﹁酱鍨嬪彿 + /// </summary> + [XmlElement] + public string CZXH { get; set; } + + /// <summary> + /// 鍔ㄦ嫋灞炴�� M锛氬姩,T锛氭嫋 M/T锛氬姩鎷栭�氱敤 + /// </summary> + [XmlElement] + public string MTTYPE { get; set; } + + /// <summary> + /// 宸﹁疆搴х洿寰凙1 + /// </summary> + [XmlElement] + public string ZLZA1 { get; set; } + + /// <summary> + /// 宸﹁疆搴х洿寰凙2 + /// </summary> + [XmlElement] + public string ZLZA2 { get; set; } + + /// <summary> + /// 宸﹁疆搴х洿寰凙3 + /// </summary> + [XmlElement] + public string ZLZA3 { get; set; } + + /// <summary> + /// 宸﹁疆搴х洿寰凙 + /// </summary> + [XmlElement] + public string ZLZA { get; set; } + + /// <summary> + /// 宸﹁疆搴х洿寰凚1 + /// </summary> + [XmlElement] + public string ZLZB1 { get; set; } + + /// <summary> + /// 宸﹁疆搴х洿寰凚2 + /// </summary> + [XmlElement] + public string ZLZB2 { get; set; } + + /// <summary> + /// 宸﹁疆搴х洿寰凚3 + /// </summary> + [XmlElement] + public string ZLZB3 { get; set; } + + /// <summary> + /// 宸﹁疆搴х洿寰凚 + /// </summary> + [XmlElement] + public string ZLZB { get; set; } + + /// <summary> + /// 宸﹁疆搴х洿寰凜1 + /// </summary> + [XmlElement] + public string ZLZC1 { get; set; } + + /// <summary> + /// 宸﹁疆搴х洿寰凜2 + /// </summary> + [XmlElement] + public string ZLZC2 { get; set; } + + /// <summary> + /// 宸﹁疆搴х洿寰凜3 + /// </summary> + [XmlElement] + public string ZLZC3 { get; set; } + + /// <summary> + /// 宸﹁疆搴х洿寰凜 + /// </summary> + [XmlElement] + public string ZLZC { get; set; } + + /// <summary> + /// 宸﹁疆搴х洿寰� + /// </summary> + [XmlElement] + public string ZLZZJ { get; set; } + + /// <summary> + /// 鍙宠疆搴х洿寰凙1 + /// </summary> + [XmlElement] + public string YLZA1 { get; set; } + + /// <summary> + /// 鍙宠疆搴х洿寰凙2 + /// </summary> + [XmlElement] + public string YLZA2 { get; set; } + + /// <summary> + /// 鍙宠疆搴х洿寰凙3 + /// </summary> + [XmlElement] + public string YLZA3 { get; set; } + + /// <summary> + /// 鍙宠疆搴х洿寰凙 + /// </summary> + [XmlElement] + public string YLZA { get; set; } + + /// <summary> + /// 鍙宠疆搴х洿寰凚1 + /// </summary> + [XmlElement] + public string YLZB1 { get; set; } + + /// <summary> + /// 鍙宠疆搴х洿寰凚2 + /// </summary> + [XmlElement] + public string YLZB2 { get; set; } + + /// <summary> + /// 鍙宠疆搴х洿寰凚3 + /// </summary> + [XmlElement] + public string YLZB3 { get; set; } + + /// <summary> + /// 鍙宠疆搴х洿寰凚 + /// </summary> + [XmlElement] + public string YLZB { get; set; } + + /// <summary> + /// 鍙宠疆搴х洿寰凜1 + /// </summary> + [XmlElement] + public string YLZC1 { get; set; } + + /// <summary> + /// 鍙宠疆搴х洿寰凜2 + /// </summary> + [XmlElement] + public string YLZC2 { get; set; } + + /// <summary> + /// 鍙宠疆搴х洿寰凜3 + /// </summary> + [XmlElement] + public string YLZC3 { get; set; } + + /// <summary> + /// 鍙宠疆搴х洿寰凜 + /// </summary> + [XmlElement] + public string YLZC { get; set; } + + /// <summary> + /// 鍙宠疆搴х洿寰� + /// </summary> + [XmlElement] + public string YLZZJ { get; set; } + + /// <summary> + /// 宸﹁疆搴х瓑绾� + /// </summary> + [XmlElement] + public string ZLZDJ { get; set; } + + /// <summary> + /// 鍙宠疆搴х瓑绾� + /// </summary> + [XmlElement] + public string YLZDJ { get; set; } + + /// <summary> + /// 缁翠慨浠诲姟 + /// </summary> + [XmlElement] + public string WXRW { get; set; } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Common/ZY/ZDPInfo_ZY.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Common/ZY/ZDPInfo_ZY.cs" new file mode 100644 index 0000000..9d5be92 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Common/ZY/ZDPInfo_ZY.cs" @@ -0,0 +1,163 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Xml.Serialization; + +namespace WIDESEA_Common.ZY +{ + [XmlRoot("ROOT")] + public class ZDPInfo_ZY : Basic_ZY + { + ///// <summary> + ///// 鏍囪瘑 + ///// </summary> + //[XmlElement] + //public string FLAG { get; set; } + + ///// <summary> + ///// 閿欒淇℃伅 + ///// </summary> + //[XmlElement] + //public string ERROR { get; set; } + + /// <summary> + /// 杞寸洏鏉$爜 + /// </summary> + [XmlElement] + public string ZPH { get; set; } + + /// <summary> + /// 杞﹀瀷 + /// </summary> + [XmlElement] + public string CHEXING { get; set; } + + /// <summary> + /// 鏂版棫灞炴�� 1锛氭棫 0 锛氭柊 + /// </summary> + [XmlElement] + public string NEWOLD { get; set; } + + /// <summary> + /// 浣嶇疆(渚�/涓�) + /// </summary> + [XmlElement] + public string POS { get; set; } + + /// <summary> + /// 铻烘爴鍨嬪彿 + /// </summary> + [XmlElement] + public string LSXH { get; set; } + + /// <summary> + /// 鏉愯川(閾搁挗) + /// </summary> + [XmlElement] + public string MAT { get; set; } + + /// <summary> + /// 浜у湴(杩涘彛/鍥戒骇) + /// </summary> + [XmlElement] + public string SITE { get; set; } + + /// <summary> + /// 姣傚瓟鐩村緞A1 + /// </summary> + [XmlElement] + public string GKA1 { get; set; } + + /// <summary> + /// 姣傚瓟鐩村緞A2 + /// </summary> + [XmlElement] + public string GKA2 { get; set; } + + /// <summary> + /// 姣傚瓟鐩村緞A3 + /// </summary> + [XmlElement] + public string GKA3 { get; set; } + + /// <summary> + /// 姣傚瓟鐩村緞A + /// </summary> + [XmlElement] + public string GKA { get; set; } + + /// <summary> + /// 姣傚瓟鐩村緞B1 + /// </summary> + [XmlElement] + public string GKB1 { get; set; } + + /// <summary> + /// 姣傚瓟鐩村緞B2 + /// </summary> + [XmlElement] + public string GKB2 { get; set; } + + /// <summary> + /// 姣傚瓟鐩村緞B3 + /// </summary> + [XmlElement] + public string GKB3 { get; set; } + + /// <summary> + /// 姣傚瓟鐩村緞B + /// </summary> + [XmlElement] + public string GKB { get; set; } + + /// <summary> + /// 姣傚瓟鐩村緞C1 + /// </summary> + [XmlElement] + public string GKC1 { get; set; } + + /// <summary> + /// 姣傚瓟鐩村緞C2 + /// </summary> + [XmlElement] + public string GKC2 { get; set; } + + /// <summary> + /// 姣傚瓟鐩村緞C3 + /// </summary> + [XmlElement] + public string GKC3 { get; set; } + + /// <summary> + /// 姣傚瓟鐩村緞C + /// </summary> + [XmlElement] + public string GKC { get; set; } + + /// <summary> + /// 姣傚瓟鐩村緞 + /// </summary> + [XmlElement] + public string GKJZ { get; set; } + + /// <summary> + /// 铻烘爴渚у墿浣欑(鑰� + /// </summary> + [XmlElement] + public string LSCSYMH { get; set; } + + /// <summary> + /// 铻烘瘝渚у墿浣欑(鑰� + /// </summary> + [XmlElement] + public string LMCSYMH { get; set; } + + /// <summary> + /// 鍏ュ簱鏃堕棿 + /// </summary> + [XmlElement] + public string RKSJ { get; set; } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Common/ZY/clinfo.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Common/ZY/clinfo.cs" new file mode 100644 index 0000000..bfc752f --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Common/ZY/clinfo.cs" @@ -0,0 +1,40 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WIDESEA_Common +{ + /// <summary> + /// 杞﹁疆 + /// </summary> + public class CLInfo + { + public string cltm { get; set; } + } + + /// <summary> + /// 鍒跺姩鐩� + /// </summary> + public class ZDPInfo + { + public string zdptm { get; set; } + } + + /// <summary> + /// 杞﹁酱 + /// </summary> + public class CZinfo + { + public string s_barcode { get; set; } + } + + public class RequestReportToSCE_ZY + { + public string s_eqptno { get; set; } + + public string s_source { get; set; } + } + +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/AOP/LogAOP.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/AOP/LogAOP.cs" new file mode 100644 index 0000000..50c3754 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/AOP/LogAOP.cs" @@ -0,0 +1,328 @@ +锘縰sing Castle.DynamicProxy; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.SignalR; +using Newtonsoft.Json; +using StackExchange.Profiling; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Reflection; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Core.Helper; +using WIDESEA_Core.LogHelper; + +namespace WIDESEA_Core.AOP +{ + /// <summary> + /// 鎷︽埅鍣˙logLogAOP 缁ф壙IInterceptor鎺ュ彛 + /// </summary> + public class LogAOP : IInterceptor + { + private readonly IHttpContextAccessor _accessor; + + public LogAOP(IHttpContextAccessor accessor) + { + _accessor = accessor; + } + + /// <summary> + /// 瀹炰緥鍖朓Interceptor鍞竴鏂规硶 + /// </summary> + /// <param name="invocation">鍖呭惈琚嫤鎴柟娉曠殑淇℃伅</param> + public void Intercept(IInvocation invocation) + { + string UserName = _accessor.HttpContext?.User?.Identity?.Name; + string json; + try + { + if (invocation.Arguments.Any()) + { + json = JsonConvert.SerializeObject(invocation.Arguments); + } + else + { + json = "鏃犲弬鏁�"; + } + } + catch (Exception ex) + { + json = "鏃犳硶搴忓垪鍖栵紝鍙兘鏄叞濮嗚揪琛ㄨ揪寮忕瓑鍘熷洜閫犳垚锛屾寜鐓ф鏋朵紭鍖栦唬鐮�" + ex.ToString(); + } + + DateTime startTime = DateTime.Now; + AOPLogInfo apiLogAopInfo = new AOPLogInfo + { + RequestTime = startTime.ToString("yyyy-MM-dd hh:mm:ss fff"), + OpUserName = "銆愬綋鍓嶆搷浣滅敤鎴枫�戯細" + UserName, + RequestMethodName = "銆愬綋鍓嶆墽琛屾柟娉曘�戯細" + invocation.Method.Name, + RequestParamsName = "銆愭惡甯︾殑鍙傛暟鏈夈�戯細" + string.Join(", ", invocation.Arguments.Select(a => (a ?? "").ToString()).ToArray()), + RequestParamsData = json + }; + + var dataIntercept = $""; + + try + { + MiniProfiler.Current.Step($"鎵ц{invocation.InvocationTarget}.{invocation.Method.Name}()鏂规硶 -> "); + //鍦ㄨ鎷︽埅鐨勬柟娉曟墽琛屽畬姣曞悗 缁х画鎵ц褰撳墠鏂规硶锛屾敞鎰忔槸琚嫤鎴殑鏄紓姝ョ殑 + invocation.Proceed(); + + // 寮傛鑾峰彇寮傚父锛屽厛鎵ц + if (IsAsyncMethod(invocation.Method)) + { + #region 鏂规涓� + + //Wait task execution and modify return value + if (invocation.Method.ReturnType == typeof(Task)) + { + invocation.ReturnValue = InternalAsyncHelper.AwaitTaskWithPostActionAndFinally( + (Task)invocation.ReturnValue, + async () => await SuccessAction(invocation, apiLogAopInfo, startTime), /*鎴愬姛鏃舵墽琛�*/ + ex => + { + LogEx(ex, apiLogAopInfo); + }); + } + //Task<TResult> + else + { + invocation.ReturnValue = InternalAsyncHelper.CallAwaitTaskWithPostActionAndFinallyAndGetResult( + invocation.Method.ReturnType.GenericTypeArguments[0], + invocation.ReturnValue, + //async () => await SuccessAction(invocation, dataIntercept),/*鎴愬姛鏃舵墽琛�*/ + async (o) => await SuccessAction(invocation, apiLogAopInfo, startTime, o), /*鎴愬姛鏃舵墽琛�*/ + ex => + { + LogEx(ex, apiLogAopInfo); + }); + } + + #endregion 鏂规涓� + + // 濡傛灉鏂规涓�涓嶈锛岃瘯璇曡繖涓柟妗� + //#region 鏂规浜� + + //var type = invocation.Method.ReturnType; + //var resultProperty = type.GetProperty("Result"); + //DateTime endTime = DateTime.Now; + //string ResponseTime = (endTime - startTime).Milliseconds.ToString(); + //apiLogAopInfo.ResponseTime = endTime.ToString("yyyy-MM-dd hh:mm:ss fff"); + //apiLogAopInfo.ResponseIntervalTime = ResponseTime + "ms"; + //apiLogAopInfo.ResponseJsonData = JsonConvert.SerializeObject(resultProperty.GetValue(invocation.ReturnValue)); + + ////dataIntercept += ($"銆愬搷搴旀椂闂淬�戯細{ResponseTime}ms\r\n"); + ////dataIntercept += ($"銆愭墽琛屽畬鎴愭椂闂淬�戯細{endTime.ToString("yyyy-MM-dd hh:mm:ss fff")}\r\n"); + ////dataIntercept += ($"銆愭墽琛屽畬鎴愮粨鏋溿�戯細{JsonConvert.SerializeObject(resultProperty.GetValue(invocation.ReturnValue))}\r\n"); + + //Parallel.For(0, 1, e => + //{ + // //LogLock.OutLogAOP("AOPLog", new string[] { dataIntercept }); + // LogLock.OutLogAOP("AOPLog", new string[] { apiLogAopInfo.GetType().ToString() + " - ResponseJsonDataType:" + type, JsonConvert.SerializeObject(apiLogAopInfo) }); + //}); + + //#endregion + } + else + { + // 鍚屾1 + string jsonResult; + try + { + jsonResult = JsonConvert.SerializeObject(invocation.ReturnValue); + } + catch (Exception ex) + { + jsonResult = "鏃犳硶搴忓垪鍖栵紝鍙兘鏄叞濮嗚揪琛ㄨ揪寮忕瓑鍘熷洜閫犳垚锛屾寜鐓ф鏋朵紭鍖栦唬鐮�" + ex.ToString(); + } + + var type = invocation.Method.ReturnType; + var resultProperty = type.GetProperty("Result"); + DateTime endTime = DateTime.Now; + string ResponseTime = (endTime - startTime).Milliseconds.ToString(); + apiLogAopInfo.ResponseTime = endTime.ToString("yyyy-MM-dd hh:mm:ss fff"); + apiLogAopInfo.ResponseIntervalTime = ResponseTime + "ms"; + apiLogAopInfo.ResponseJsonData = jsonResult; + Parallel.For(0, 1, e => + { + LogLock.OutLogAOP("AOPLog", new string[] { apiLogAopInfo.GetType().ToString(), JsonConvert.SerializeObject(apiLogAopInfo) }); + }); + } + } + catch (Exception ex) // 鍚屾2 + { + LogEx(ex, apiLogAopInfo); + throw; + } + } + + private async Task SuccessAction(IInvocation invocation, AOPLogInfo apiLogAopInfo, DateTime startTime, object o = null) + { + DateTime endTime = DateTime.Now; + string ResponseTime = (endTime - startTime).Milliseconds.ToString(); + apiLogAopInfo.ResponseTime = endTime.ToString("yyyy-MM-dd hh:mm:ss fff"); + apiLogAopInfo.ResponseIntervalTime = ResponseTime + "ms"; + apiLogAopInfo.ResponseJsonData = JsonConvert.SerializeObject(o); + + await Task.Run(() => + { + Parallel.For(0, 1, e => + { + //LogLock.OutSql2Log("AOPLog", new string[] { JsonConvert.SerializeObject(apiLogAopInfo) }); + LogLock.OutLogAOP("AOPLog", new string[] { apiLogAopInfo.GetType().ToString(), JsonConvert.SerializeObject(apiLogAopInfo) }); + }); + }); + } + + private void LogEx(Exception ex, AOPLogInfo dataIntercept) + { + if (ex != null) + { + //鎵ц鐨� service 涓紝鏀跺綍寮傚父 + MiniProfiler.Current.CustomTiming("Errors锛�", ex.Message); + //鎵ц鐨� service 涓紝鎹曡幏寮傚父 + AOPLogExInfo apiLogAopExInfo = new AOPLogExInfo + { + ExMessage = ex.Message, + InnerException = "InnerException-鍐呴儴寮傚父:\r\n" + (ex.InnerException == null ? "" : ex.InnerException.InnerException.ToString()) + + "\r\nStackTrace-鍫嗘爤璺熻釜:\r\n" + (ex.StackTrace == null ? "" : ex.StackTrace.ToString()), + ApiLogAopInfo = dataIntercept + }; + // 寮傚父鏃ュ織閲屾湁璇︾粏鐨勫爢鏍堜俊鎭� + Parallel.For(0, 1, e => + { + LogLock.OutLogAOP("AOPLogEx", new string[] { apiLogAopExInfo.GetType().ToString(), JsonConvert.SerializeObject(apiLogAopExInfo) }); + }); + } + } + + public static bool IsAsyncMethod(MethodInfo method) + { + return + method.ReturnType == typeof(Task) || + method.ReturnType.IsGenericType && method.ReturnType.GetGenericTypeDefinition() == typeof(Task<>) + ; + } + } + + internal static class InternalAsyncHelper + { + public static async Task AwaitTaskWithPostActionAndFinally(Task actualReturnValue, Func<Task> postAction, Action<Exception> finalAction) + { + Exception exception = null; + + try + { + await actualReturnValue; + await postAction(); + } + catch (Exception ex) + { + exception = ex; + } + finally + { + finalAction(exception); + } + } + + public static async Task<T> AwaitTaskWithPostActionAndFinallyAndGetResult<T>(Task<T> actualReturnValue, Func<object, Task> postAction, + Action<Exception> finalAction) + { + Exception exception = null; + try + { + var result = await actualReturnValue; + await postAction(result); + return result; + } + catch (Exception ex) + { + exception = ex; + throw; + } + finally + { + finalAction(exception); + } + } + + public static object CallAwaitTaskWithPostActionAndFinallyAndGetResult(Type taskReturnType, object actualReturnValue, + Func<object, Task> action, Action<Exception> finalAction) + { + return typeof(InternalAsyncHelper) + .GetMethod("AwaitTaskWithPostActionAndFinallyAndGetResult", BindingFlags.Public | BindingFlags.Static) + .MakeGenericMethod(taskReturnType) + .Invoke(null, new object[] { actualReturnValue, action, finalAction }); + } + } + + public class AOPLogInfo + { + /// <summary> + /// 璇锋眰鏃堕棿 + /// </summary> + [Description("璇锋眰鏃堕棿")] + public string RequestTime { get; set; } = string.Empty; + + /// <summary> + /// 鎿嶄綔浜哄憳 + /// </summary> + [Description("鎿嶄綔浜哄憳")] + public string OpUserName { get; set; } = string.Empty; + + /// <summary> + /// 璇锋眰鏂规硶鍚� + /// </summary> + [Description("璇锋眰鏂规硶鍚�")] + public string RequestMethodName { get; set; } = string.Empty; + + /// <summary> + /// 璇锋眰鍙傛暟鍚� + /// </summary> + [Description("璇锋眰鍙傛暟鍚�")] + public string RequestParamsName { get; set; } = string.Empty; + + /// <summary> + /// 璇锋眰鍙傛暟鏁版嵁JSON + /// </summary> + [Description("璇锋眰鍙傛暟鏁版嵁JSON")] + public string RequestParamsData { get; set; } = string.Empty; + + /// <summary> + /// 璇锋眰鍝嶅簲闂撮殧鏃堕棿 + /// </summary> + [Description("璇锋眰鍝嶅簲闂撮殧鏃堕棿")] + public string ResponseIntervalTime { get; set; } = string.Empty; + + /// <summary> + /// 鍝嶅簲鏃堕棿 + /// </summary> + [Description("鍝嶅簲鏃堕棿")] + public string ResponseTime { get; set; } = string.Empty; + + /// <summary> + /// 鍝嶅簲缁撴灉 + /// </summary> + [Description("鍝嶅簲缁撴灉")] + public string ResponseJsonData { get; set; } = string.Empty; + } + + public class AOPLogExInfo + { + public AOPLogInfo ApiLogAopInfo { get; set; } + + /// <summary> + /// 寮傚父 + /// </summary> + [Description("寮傚父")] + public string InnerException { get; set; } = string.Empty; + + /// <summary> + /// 寮傚父淇℃伅 + /// </summary> + [Description("寮傚父淇℃伅")] + public string ExMessage { get; set; } = string.Empty; + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/AOP/SqlSugarAop.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/AOP/SqlSugarAop.cs" new file mode 100644 index 0000000..e0880c9 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/AOP/SqlSugarAop.cs" @@ -0,0 +1,72 @@ +锘縰sing SqlSugar; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Core.Const; +using WIDESEA_Core.DB.Models; +using WIDESEA_Core.Helper; +using WIDESEA_Core.Tenants; + +namespace WIDESEA_Core.AOP +{ + public static class SqlSugarAop + { + public static void DataExecuting(object oldValue, DataFilterModel entityInfo) + { + if (entityInfo.EntityValue is BaseEntity baseEntity) + { + // 鏂板鎿嶄綔 + if (entityInfo.OperationType == DataFilterType.InsertByObject) + { + if (entityInfo.PropertyName == nameof(BaseEntity.CreateDate)) + { + baseEntity.CreateDate = DateTime.Now; + } + } + + if (entityInfo.OperationType == DataFilterType.UpdateByObject) + { + baseEntity.ModifyDate = DateTime.Now; + } + + + if (App.User?.UserId > 0) + { + switch (entityInfo.OperationType) + { + case DataFilterType.UpdateByObject: + baseEntity.Modifier = App.User.UserName; + break; + case DataFilterType.InsertByObject: + baseEntity.Creater = App.User.UserName; + break; + } + } + } + } + + private static string GetWholeSql(SugarParameter[] paramArr, string sql) + { + foreach (var param in paramArr) + { + sql = sql.Replace(param.ParameterName, $@"'{param.Value.ObjToString()}'"); + } + + return sql; + } + + private static string GetParas(SugarParameter[] pars) + { + string key = "銆怱QL鍙傛暟銆戯細"; + foreach (var param in pars) + { + key += $"{param.ParameterName}:{param.Value}\n"; + } + + return key; + } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/App.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/App.cs" new file mode 100644 index 0000000..243735e --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/App.cs" @@ -0,0 +1,202 @@ +锘縰sing Microsoft.AspNetCore.Hosting; +using Microsoft.AspNetCore.Http; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using Microsoft.Extensions.Options; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Core.Core; +using WIDESEA_Core.Helper; +using WIDESEA_Core.HttpContextUser; + +namespace WIDESEA_Core +{ + public class App + { + static App() + { + EffectiveTypes = Assemblies.SelectMany(GetTypes); + } + + private static bool _isRun; + + /// <summary>鏄惁姝e湪杩愯</summary> + public static bool IsBuild { get; set; } + + public static bool IsRun + { + get => _isRun; + set => _isRun = IsBuild = value; + } + + /// <summary>搴旂敤鏈夋晥绋嬪簭闆�</summary> + public static readonly IEnumerable<Assembly> Assemblies = RuntimeExtension.GetAllAssemblies(); + + /// <summary>鏈夋晥绋嬪簭闆嗙被鍨�</summary> + public static readonly IEnumerable<Type> EffectiveTypes; + + /// <summary>浼樺厛浣跨敤App.GetService()鎵嬪姩鑾峰彇鏈嶅姟</summary> + public static IServiceProvider RootServices => IsRun || IsBuild ? InternalApp.RootServices : null; + + /// <summary>鑾峰彇Web涓绘満鐜锛屽锛屾槸鍚︽槸寮�鍙戠幆澧冿紝鐢熶骇鐜绛�</summary> + public static IWebHostEnvironment WebHostEnvironment => InternalApp.WebHostEnvironment; + + /// <summary>鑾峰彇娉涘瀷涓绘満鐜锛屽锛屾槸鍚︽槸寮�鍙戠幆澧冿紝鐢熶骇鐜绛�</summary> + public static IHostEnvironment HostEnvironment => InternalApp.HostEnvironment; + + /// <summary>鍏ㄥ眬閰嶇疆閫夐」</summary> + public static IConfiguration Configuration => InternalApp.Configuration; + + /// <summary> + /// 鑾峰彇璇锋眰涓婁笅鏂� + /// </summary> + public static HttpContext HttpContext => RootServices?.GetService<IHttpContextAccessor>()?.HttpContext; + + public static IUser User => GetService<IUser>(); + + #region Service + + /// <summary>瑙f瀽鏈嶅姟鎻愪緵鍣�</summary> + /// <param name="serviceType"></param> + /// <param name="mustBuild"></param> + /// <param name="throwException"></param> + /// <returns></returns> + public static IServiceProvider GetServiceProvider(Type serviceType, bool mustBuild = false, bool throwException = true) + { + if (App.HostEnvironment == null || App.RootServices != null && + InternalApp.InternalServices + .Where((u => + u.ServiceType == + (serviceType.IsGenericType ? serviceType.GetGenericTypeDefinition() : serviceType))) + .Any((u => u.Lifetime == ServiceLifetime.Singleton))) + return App.RootServices; + + //鑾峰彇璇锋眰鐢熷瓨鍛ㄦ湡鐨勬湇鍔� + if (HttpContext?.RequestServices != null) + return HttpContext.RequestServices; + + if (App.RootServices != null) + { + IServiceScope scope = RootServices.CreateScope(); + return scope.ServiceProvider; + } + + if (mustBuild) + { + if (throwException) + { + throw new ApplicationException("褰撳墠涓嶅彲鐢紝蹇呴』瑕佺瓑鍒� WebApplication Build鍚�"); + } + + return default; + } + + ServiceProvider serviceProvider = InternalApp.InternalServices.BuildServiceProvider(); + return serviceProvider; + } + + public static TService GetService<TService>(bool mustBuild = true) where TService : class + { + TService test = App.GetService(typeof(TService), null, mustBuild) as TService; + return test; + } + + /// <summary>鑾峰彇璇锋眰鐢熷瓨鍛ㄦ湡鐨勬湇鍔�</summary> + /// <typeparam name="TService"></typeparam> + /// <param name="serviceProvider"></param> + /// <param name="mustBuild"></param> + /// <returns></returns> + public static TService GetService<TService>(IServiceProvider serviceProvider, bool mustBuild = true) + where TService : class => (serviceProvider ?? App.GetServiceProvider(typeof(TService), mustBuild, false))?.GetService<TService>(); + + /// <summary>鑾峰彇璇锋眰鐢熷瓨鍛ㄦ湡鐨勬湇鍔�</summary> + /// <param name="type"></param> + /// <param name="serviceProvider"></param> + /// <param name="mustBuild"></param> + /// <returns></returns> + public static object GetService(Type type, IServiceProvider serviceProvider = null, bool mustBuild = true) + { + object obj = (serviceProvider ?? App.GetServiceProvider(type, mustBuild, false))?.GetService(type); + return obj; + } + + + #endregion + + #region private + + /// <summary>鍔犺浇绋嬪簭闆嗕腑鐨勬墍鏈夌被鍨�</summary> + /// <param name="ass"></param> + /// <returns></returns> + private static IEnumerable<Type> GetTypes(Assembly ass) + { + Type[] source = Array.Empty<Type>(); + try + { + source = ass.GetTypes(); + } + catch + { + //$@"Error load `{ass.FullName}` assembly.".WriteErrorLine(); + } + + return source.Where(u => u.IsPublic); + } + + #endregion + + #region Options + + /// <summary>鑾峰彇閰嶇疆</summary> + /// <typeparam name="TOptions">寮虹被鍨嬮�夐」绫�</typeparam> + /// <returns>TOptions</returns> + public static TOptions GetConfig<TOptions>() + where TOptions : class, IConfigurableOptions + { + TOptions instance = App.Configuration + .GetSection(ConfigurableOptions.GetConfigurationPath(typeof(TOptions))) + .Get<TOptions>(); + return instance; + } + + /// <summary>鑾峰彇閫夐」</summary> + /// <typeparam name="TOptions">寮虹被鍨嬮�夐」绫�</typeparam> + /// <param name="serviceProvider"></param> + /// <returns>TOptions</returns> + public static TOptions GetOptions<TOptions>(IServiceProvider serviceProvider = null) where TOptions : class, new() + { + IOptions<TOptions> service = App.GetService<IOptions<TOptions>>(serviceProvider ?? App.RootServices, false); + return service?.Value; + } + + /// <summary>鑾峰彇閫夐」</summary> + /// <typeparam name="TOptions">寮虹被鍨嬮�夐」绫�</typeparam> + /// <param name="serviceProvider"></param> + /// <returns>TOptions</returns> + public static TOptions GetOptionsMonitor<TOptions>(IServiceProvider serviceProvider = null) + where TOptions : class, new() + { + IOptionsMonitor<TOptions> service = + App.GetService<IOptionsMonitor<TOptions>>(serviceProvider ?? App.RootServices, false); + return service?.CurrentValue; + } + + /// <summary>鑾峰彇閫夐」</summary> + /// <typeparam name="TOptions">寮虹被鍨嬮�夐」绫�</typeparam> + /// <param name="serviceProvider"></param> + /// <returns>TOptions</returns> + public static TOptions GetOptionsSnapshot<TOptions>(IServiceProvider serviceProvider = null) + where TOptions : class, new() + { + IOptionsSnapshot<TOptions> service = App.GetService<IOptionsSnapshot<TOptions>>(serviceProvider, false); + return service?.Value; + } + + #endregion + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Authorization/AuthorizationResponse.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Authorization/AuthorizationResponse.cs" new file mode 100644 index 0000000..3db0e6a --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Authorization/AuthorizationResponse.cs" @@ -0,0 +1,46 @@ +锘縰sing Microsoft.AspNetCore.Mvc.Filters; +using Microsoft.AspNetCore.Mvc; +using System; +using System.Collections.Generic; +using System.IdentityModel.Tokens.Jwt; +using System.Linq; +using System.Net; +using System.Security.Claims; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Core.Helper; +using WIDESEA_Core.Const; + +namespace WIDESEA_Core.Authorization +{ + public static class AuthorizationResponse + { + public static AuthorizationFilterContext FilterResult( + this AuthorizationFilterContext context, + HttpStatusCode statusCode, + string message = null) + { + context.Result = new ContentResult() + { + Content = new { message, status = false, code = (int)statusCode }.Serialize(), + ContentType = "application/json", + StatusCode = (int)statusCode + }; + //Logger.Info(LoggerType.ApiAuthorize, message); + return context; + } + public static AuthorizationFilterContext Unauthorized(this AuthorizationFilterContext context, string message = null) + { + return context.FilterResult(HttpStatusCode.Unauthorized, message); + } + //涓嶉�氳繃JWT楠岃瘉鐨勶紝鐩存帴灏嗙敤鎴蜂俊鎭紦瀛樿捣鏉� + public static void AddIdentity(this AuthorizationFilterContext context, int? userId = null) + { + int _userId = userId ?? JwtHelper.GetUserId(context.HttpContext.Request.Headers[AppSecret.TokenHeaderName]); + if (_userId <= 0) return; + //灏嗙敤鎴稩d缂撳瓨鍒颁笂涓嬫枃(鎴栬�呰嚜瀹氫竴涓璞★紝閫氳繃DI浠ddScoped鏂瑰紡娉ㄥ叆涓婁笅鏂囨潵绠$悊鐢ㄦ埛淇℃伅) + var claims = new Claim[] { new Claim(JwtRegisteredClaimNames.Jti, _userId.ToString()) }; + context.HttpContext.User.AddIdentity(new ClaimsIdentity(claims)); + } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Authorization/AuthorizationSetup.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Authorization/AuthorizationSetup.cs" new file mode 100644 index 0000000..31cff24 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Authorization/AuthorizationSetup.cs" @@ -0,0 +1,67 @@ +锘縰sing Microsoft.AspNetCore.Authentication.JwtBearer; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Http; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.IdentityModel.Tokens; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Security.Claims; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Core.Const; +using WIDESEA_Core.Helper; + +namespace WIDESEA_Core.Authorization +{ + /// <summary> + /// 绯荤粺 鎺堟潈鏈嶅姟 閰嶇疆 + /// </summary> + public static class AuthorizationSetup + { + /// <summary> + /// 绯荤粺 鎺堟潈鏈嶅姟 閰嶇疆 + /// </summary> + /// <param name="services"></param> + /// <exception cref="ArgumentNullException"></exception> + public static void AddAuthorizationSetup(this IServiceCollection services) + { + if (services == null) throw new ArgumentNullException(nameof(services)); + + services.AddAuthentication(options => + { + options.DefaultAuthenticateScheme = JwtBearerDefaults.AuthenticationScheme; + options.DefaultChallengeScheme = JwtBearerDefaults.AuthenticationScheme; + options.DefaultScheme = JwtBearerDefaults.AuthenticationScheme; + }) + .AddJwtBearer(options => + { + options.TokenValidationParameters = new TokenValidationParameters + { + SaveSigninToken = true,//淇濆瓨token,鍚庡彴楠岃瘉token鏄惁鐢熸晥(閲嶈) + ValidateIssuer = true,//鏄惁楠岃瘉Issuer + ValidateAudience = true,//鏄惁楠岃瘉Audience + ValidateLifetime = true,//鏄惁楠岃瘉澶辨晥鏃堕棿 + ValidateIssuerSigningKey = true,//鏄惁楠岃瘉SecurityKey + ValidAudience = AppSecret.Audience,//Audience + ValidIssuer = AppSecret.Issuer,//Issuer锛岃繖涓ら」鍜屽墠闈㈢鍙慾wt鐨勮缃竴鑷� + IssuerSigningKey = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(AppSecret.JWT)) + }; + options.Events = new JwtBearerEvents() + { + OnChallenge = context => + { + context.HandleResponse(); + context.Response.Clear(); + context.Response.ContentType = "application/json"; + context.Response.StatusCode = 401; + context.Response.WriteAsync(new { message = "鎺堟潈鏈�氳繃", status = false, code = 401 }.Serialize()); + return Task.CompletedTask; + } + }; + }); + + services.AddSingleton<IHttpContextAccessor, HttpContextAccessor>(); + } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Authorization/JwtHelper.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Authorization/JwtHelper.cs" new file mode 100644 index 0000000..2669558 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Authorization/JwtHelper.cs" @@ -0,0 +1,118 @@ +锘縰sing Microsoft.IdentityModel.Tokens; +using System; +using System.Collections.Generic; +using System.IdentityModel.Tokens.Jwt; +using System.Linq; +using System.Security.Claims; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Core.Const; +using WIDESEA_Core.Helper; +using WIDESEA_Core.HttpContextUser; + +namespace WIDESEA_Core.Authorization +{ + public class JwtHelper + { + + /// <summary> + /// 鐢熸垚JWT + /// </summary> + /// <param name="serInfo"></param> + /// <returns></returns> + public static string IssueJwt(TokenModelJwt tokenModel) + { + string exp = $"{new DateTimeOffset(DateTime.Now.AddMinutes(/*tokenModel.UserId == 1 ? 43200 : */AppSettings.app("ExpMinutes").ObjToInt())).ToUnixTimeSeconds()}"; + var claims = new List<Claim> + { + new Claim(JwtRegisteredClaimNames.Jti,tokenModel.UserId.ToString()), + new Claim(JwtRegisteredClaimNames.Iat, $"{new DateTimeOffset(DateTime.Now).ToUnixTimeSeconds()}"), + new Claim(JwtRegisteredClaimNames.Nbf,$"{new DateTimeOffset(DateTime.Now).ToUnixTimeSeconds()}") , + //JWT杩囨湡鏃堕棿 + //榛樿璁剧疆jwt杩囨湡鏃堕棿120鍒嗛挓 + new Claim (JwtRegisteredClaimNames.Exp,exp), + new Claim(JwtRegisteredClaimNames.Iss,AppSecret.Issuer), + new Claim(JwtRegisteredClaimNames.Aud,AppSecret.Audience), + new Claim(ClaimTypes.Role, tokenModel.RoleId.ToString()) + }; + + // 鍙互灏嗕竴涓敤鎴风殑澶氫釜瑙掕壊鍏ㄩ儴璧嬩簣锛� + // 浣滆�咃細DX 鎻愪緵鎶�鏈敮鎸侊紱 + + //绉橀挜16浣� + var key = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(AppSecret.JWT)); + var creds = new SigningCredentials(key, SecurityAlgorithms.HmacSha256); + JwtSecurityToken securityToken = new JwtSecurityToken(issuer: AppSecret.Issuer, claims: claims, signingCredentials: creds); + string jwt = new JwtSecurityTokenHandler().WriteToken(securityToken); + return jwt; + } + + /// <summary> + /// 瑙f瀽 + /// </summary> + /// <param name="jwtStr"></param> + /// <returns></returns> + public static UserInfo SerializeJwt(string jwtStr) + { + var jwtHandler = new JwtSecurityTokenHandler(); + JwtSecurityToken jwtToken = jwtHandler.ReadJwtToken(jwtStr); + UserInfo userInfo = new UserInfo + { + UserId = Convert.ToInt32(jwtToken.Id), + RoleId = (jwtToken.Payload[ClaimTypes.Role] ?? 0).ObjToInt(), + }; + return userInfo; + } + /// <summary> + /// 鑾峰彇杩囨湡鏃堕棿 + /// </summary> + /// <param name="jwtStr"></param> + /// <returns></returns> + public static DateTime GetExp(string jwtStr) + { + var jwtHandler = new JwtSecurityTokenHandler(); + JwtSecurityToken jwtToken = jwtHandler.ReadJwtToken(jwtStr); + + DateTime expDate = (jwtToken.Payload[JwtRegisteredClaimNames.Exp] ?? 0).ObjToInt().GetTimeSpmpToDate(); + return expDate; + } + public static bool IsExp(string jwtStr) + { + return GetExp(jwtStr) < DateTime.Now; + } + + public static int GetUserId(string jwtStr) + { + try + { + if (jwtStr.IsNullOrEmpty()) return 0; + jwtStr = jwtStr.Replace("Bearer ", ""); + return new JwtSecurityTokenHandler().ReadJwtToken(jwtStr).Id.ObjToInt(); + } + catch + { + return 0; + } + } + } + + /// <summary> + /// 浠ょ墝 + /// </summary> + public class TokenModelJwt + { + /// <summary> + /// UserId + /// </summary> + public long UserId { get; set; } + /// <summary> + /// 瑙掕壊 + /// </summary> + public int RoleId { get; set; } + /// <summary> + /// 鑱岃兘 + /// </summary> + public string Work { get; set; } + + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/BaseController/ApiBaseController.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/BaseController/ApiBaseController.cs" new file mode 100644 index 0000000..cd3872c --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/BaseController/ApiBaseController.cs" @@ -0,0 +1,111 @@ +锘縰sing Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using Microsoft.Extensions.Options; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Core.BaseServices; + +namespace WIDESEA_Core.BaseController +{ + [Authorize, ApiController] + public class ApiBaseController<IService, TEntity> : Controller + { + protected IService Service; + + public ApiBaseController(IService service) + { + Service = service; + } + + [HttpPost, Route("GetPageData")] + public virtual ActionResult GetPageData([FromBody] PageDataOptions options) + { + return Json(InvokeService("GetPageData", new object[] { options })); + } + + [HttpPost, Route("GetDetailPage")] + public virtual ActionResult GetDetailPage([FromBody] PageDataOptions pageData) + { + return Json(InvokeService("GetDetailPage", new object[] { pageData })); + } + + [HttpPost, Route("AddData")] + public virtual ActionResult AddData([FromBody] TEntity options) + { + return Json(InvokeService("AddData", new object[] { options })); + } + + [HttpPost, Route("Add")] + public virtual ActionResult Add([FromBody] SaveModel options) + { + return Json(InvokeService("AddData", new object[] { options })); + } + + [HttpPost, Route("Update")] + public virtual ActionResult Update([FromBody] SaveModel options) + { + return Json(InvokeService("UpdateData", new object[] { options })); + } + + [HttpPost, Route("UpdateData")] + public virtual ActionResult UpdateData([FromBody] TEntity options) + { + return Json(InvokeService("UpdateData", new object[] { options })); + } + + [HttpPost, Route("Del")] + public virtual ActionResult Del([FromBody] object[] key) + { + return Json(InvokeService("DeleteData", new object[] { key })); + } + + [HttpPost, Route("Export")] + public virtual ActionResult Export([FromBody] PageDataOptions loadData) + { + WebResponseContent result = InvokeService("Export", new object[] { loadData }) as WebResponseContent; + if (result.Status) + return File( + System.IO.File.ReadAllBytes(result.Data.ToString()), + System.Net.Mime.MediaTypeNames.Application.Octet, + Path.GetFileName(result.Data.ToString()) + ); + return Json(result); + } + + [HttpPost, HttpGet, Route("DownLoadTemplate")] + public virtual ActionResult DownLoadTemplate() + { + WebResponseContent result = InvokeService("DownLoadTemplate", new object[] { }) as WebResponseContent; + if (result.Status) + return File( + System.IO.File.ReadAllBytes(result.Data.ToString()), + System.Net.Mime.MediaTypeNames.Application.Octet, + Path.GetFileName(result.Data.ToString()) + ); + return Json(result); + } + + [HttpPost, Route("Import")] + public virtual ActionResult Import(List<IFormFile> fileInput) + { + return Json(InvokeService("Import", new object[] { fileInput })); + } + + private object InvokeService(string methodName, object[] parameters) + { + Type t = Service.GetType(); + List<Type> types = new List<Type>(); + foreach (var param in parameters) + { + types.Add(param.GetType()); + } + MethodInfo method = t.GetMethod(methodName, types.ToArray()); + return method.Invoke(Service, parameters); + } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/BaseModels/PageDataOptions.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/BaseModels/PageDataOptions.cs" new file mode 100644 index 0000000..bffe798 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/BaseModels/PageDataOptions.cs" @@ -0,0 +1,35 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WIDESEA_Core +{ + public class PageDataOptions + { + public int Page { get; set; } + public int Rows { get; set; } + public int Total { get; set; } + public string TableName { get; set; } + public string Sort { get; set; } + /// <summary> + /// 鎺掑簭鏂瑰紡 + /// </summary> + public string Order { get; set; } + public string Wheres { get; set; } + public bool Export { get; set; } + public object Value { get; set; } + /// <summary> + /// 鏌ヨ鏉′欢 + /// </summary> + public List<SearchParameters> Filter { get; set; } + } + public class SearchParameters + { + public string Name { get; set; } + public string Value { get; set; } + //鏌ヨ绫诲瀷锛歀inqExpressionType + public string DisplayType { get; set; } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/BaseModels/PageGridData.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/BaseModels/PageGridData.cs" new file mode 100644 index 0000000..7ad6817 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/BaseModels/PageGridData.cs" @@ -0,0 +1,26 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WIDESEA_Core +{ + public class PageGridData<T> + { + public int Total { get; set; } + public List<T> Rows { get; set; } + public object Summary { get; set; } + + public PageGridData() + { + + } + + public PageGridData(int total, List<T> rows) + { + Total = total; + Rows = rows; + } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/BaseModels/Permissions.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/BaseModels/Permissions.cs" new file mode 100644 index 0000000..e8c006b --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/BaseModels/Permissions.cs" @@ -0,0 +1,27 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WIDESEA_Core +{ + public class Permissions + { + public int MenuId { get; set; } + public int ParentId { get; set; } + public string TableName { get; set; } + public string MenuAuth { get; set; } + public string UserAuth { get; set; } + /// <summary> + /// 褰撳墠鐢ㄦ埛鏉冮檺,瀛樺偍鐨勬槸鏉冮檺鐨勫�硷紝濡�:Add,Search绛� + /// </summary> + public string[] UserAuthArr { get; set; } + + /// <summary> + /// 2022.03.26 + /// 鑿滃崟绫诲瀷1:绉诲姩绔紝0:PC绔� + /// </summary> + public int MenuType { get; set; } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/BaseModels/SaveModel.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/BaseModels/SaveModel.cs" new file mode 100644 index 0000000..f103ccf --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/BaseModels/SaveModel.cs" @@ -0,0 +1,21 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WIDESEA_Core +{ + public class SaveModel + { + public Dictionary<string, object> MainData { get; set; } + public List<Dictionary<string, object>> DetailData { get; set; } + public List<object> DelKeys { get; set; } + + /// <summary> + /// 浠庡墠鍙颁紶鍏ョ殑鍏朵粬鍙傛暟(鑷畾涔夋墿灞曞彲浠ヤ娇鐢�) + /// </summary> + public object Extra { get; set; } + + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/BaseModels/WebResponseContent.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/BaseModels/WebResponseContent.cs" new file mode 100644 index 0000000..84c921f --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/BaseModels/WebResponseContent.cs" @@ -0,0 +1,55 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WIDESEA_Core +{ + public class WebResponseContent + { + public WebResponseContent() + { + } + public WebResponseContent(bool status) + { + Status = status; + } + public bool Status { get; set; } + + public int Code { get; set; } + + public string Message { get; set; } + + public object Data { get; set; } + + public string DevMessage { get; set; } + + public WebResponseContent OK() + { + Code = 1; + Status = true; + return this; + } + + public static WebResponseContent Instance + { + get { return new WebResponseContent(); } + } + public WebResponseContent OK(string message = null, object data = null) + { + Code = 1; + Status = true; + Message = message; + Data = data; + return this; + } + + public WebResponseContent Error(string message = null) + { + Status = false; + Message = message; + return this; + } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/BaseRepository/IRepository.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/BaseRepository/IRepository.cs" new file mode 100644 index 0000000..4a5e263 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/BaseRepository/IRepository.cs" @@ -0,0 +1,441 @@ +锘縰sing Microsoft.Data.SqlClient; +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Data; +using System.Linq; +using System.Linq.Expressions; +using System.Text; +using System.Threading.Tasks; + +namespace WIDESEA_Core.BaseRepository +{ + public interface IRepository<TEntity> : IDependency where TEntity : class, new() + { + /// <summary> + /// SqlsugarClient瀹炰綋 + /// </summary> + ISqlSugarClient Db { get; } + + /// <summary> + /// 閫氳繃涓婚敭鏌ヨ鏁版嵁 + /// </summary> + /// <param name="id">涓婚敭</param> + /// <returns>鏌ヨ缁撴灉</returns> + TEntity QureyDataById(object id); + + Task<TEntity> QureyDataByIdAsync(object id); + + /// <summary> + /// 閫氳繃涓婚敭鏁扮粍鏌ヨ鏁版嵁 + /// </summary> + /// <param name="lstIds">涓婚敭鏁扮粍</param> + /// <returns>鏌ヨ缁撴灉闆嗗悎</returns> + List<TEntity> QureyDataByIds(object[] lstIds); + + Task<List<TEntity>> QureyDataByIdsAsync(object[] lstIds); + + /// <summary> + /// 閫氳繃涓婚敭闆嗗悎鏌ヨ鏁版嵁 + /// </summary> + /// <param name="lstIds">涓婚敭闆嗗悎</param> + /// <returns>鏌ヨ缁撴灉闆嗗悎</returns> + List<TEntity> QureyDataByIds(List<object> lstIds); + + Task<List<TEntity>> QureyDataByIdsAsync(List<object> lstIds); + + /// <summary> + /// 娣诲姞鍗曟潯鏁版嵁 + /// </summary> + /// <param name="entity"></param> + /// <returns>褰卞搷琛屾暟</returns> + int AddData(TEntity entity); + + Task<int> AddDataAsync(TEntity entity); + + /// <summary> + /// 瀵艰埅鎻掑叆鏁版嵁(鍙敮鎸�2绾�) + /// </summary> + /// <param name="Entity"></param> + /// <returns></returns> + Task<bool> AddDataNavAsync(TEntity Entity); + + /// <summary> + /// 娣诲姞澶氭潯鏁版嵁 + /// </summary> + /// <param name="listEntity"></param> + /// <returns>褰卞搷琛屾暟</returns> + int AddData(List<TEntity> listEntity); + + Task<int> AddDataAsync(List<TEntity> listEntity); + + /// <summary> + /// 閫氳繃涓婚敭鍒犻櫎鏁版嵁 + /// </summary> + /// <param name="id">涓婚敭</param> + /// <returns>鍒犻櫎缁撴灉</returns> + bool DeleteDataById(object id); + + Task<bool> DeleteDataByIdAsync(object id); + + /// <summary> + /// 閫氳繃涓婚敭鏁版嵁鍒犻櫎澶氭潯鏁版嵁 + /// </summary> + /// <param name="ids">涓婚敭鏁扮粍</param> + /// <returns>鍒犻櫎缁撴灉</returns> + bool DeleteDataByIds(object[] ids); + + Task<bool> DeleteDataByIdsAsync(object[] ids); + + /// <summary> + /// 閫氳繃瀹炰綋鏁版嵁鍒犻櫎鏁版嵁 + /// </summary> + /// <param name="ids">涓婚敭鏁扮粍</param> + /// <returns>鍒犻櫎缁撴灉</returns> + bool DeleteData(TEntity entity); + + Task<bool> DeleteDataAsync(TEntity entity); + + /// <summary> + /// 閫氳繃瀹炰綋闆嗗悎鏁版嵁鍒犻櫎鏁版嵁 + /// </summary> + /// <param name="ids">涓婚敭鏁扮粍</param> + /// <returns>鍒犻櫎缁撴灉</returns> + bool DeleteData(List<TEntity> listEntity); + + Task<bool> DeleteDataAsync(List<TEntity> listEntity); + + /// <summary> + /// 鏇存柊鍗曟潯鏁版嵁 + /// </summary> + /// <param name="entity"></param> + /// <returns></returns> + bool UpdateData(TEntity entity); + + Task<bool> UpdateDataAsync(TEntity entity); + + /// <summary> + /// 鏇存柊澶氭潯鏁版嵁 + /// </summary> + /// <param name="listEntity"></param> + /// <returns></returns> + bool UpdateData(List<TEntity> listEntity); + + Task<bool> UpdateDataAsync(List<TEntity> listEntity); + + /// <summary> + /// 瀵艰埅鏇存柊鏁版嵁(鍙敮鎸�2绾�) + /// </summary> + /// <param name="Entity"></param> + /// <returns></returns> + Task<bool> UpdateDataNavAsync(TEntity Entity); + + /// <summary> + /// 瀵艰埅鏇存柊鏁版嵁(鍙敮鎸�2绾�) + /// </summary> + /// <param name="Entity"></param> + /// <returns></returns> + bool UpdateDataNav(TEntity Entity); + + /// <summary> + /// 鎸囧畾鍒楁洿鏂版暟鎹� + /// </summary> + /// <param name="entity"></param> + /// <param name="lstColumns"></param> + /// <param name="lstIgnoreColumns"></param> + /// <returns></returns> + bool UpdateData(TEntity entity, List<string> lstColumns, List<string>? lstIgnoreColumns = null); + + Task<bool> UpdateDataAsync(TEntity entity, List<string> lstColumns, List<string>? lstIgnoreColumns = null); + + /// <summary> + /// 鏌ヨ鎵�鏈夋暟鎹� + /// </summary> + /// <returns></returns> + List<TEntity> QueryData(); + + Task<List<TEntity>> QueryDataAsync(); + + /// <summary> + /// 鏉′欢鏌ヨ鏁版嵁 + /// </summary> + /// <param name="where"></param> + /// <returns></returns> + List<TEntity> QueryData(string where); + + Task<List<TEntity>> QueryDataAsync(string where); + + /// <summary> + /// 鏉′欢鏌ヨ鏁版嵁 + /// </summary> + /// <param name="whereExpression"></param> + /// <returns></returns> + List<TEntity> QueryData(Expression<Func<TEntity, bool>> whereExpression); + + Task<List<TEntity>> QueryDataAsync(Expression<Func<TEntity, bool>> whereExpression); + + TEntity QueryFirst(Expression<Func<TEntity, bool>> whereExpression); + + Task<TEntity> QueryFirstAsync(Expression<Func<TEntity, bool>> whereExpression); + + Task<TEntity> QueryFirstNavAsync(Expression<Func<TEntity, bool>> whereExpression); + + TResult QueryFirst<TResult>(Expression<Func<TEntity, bool>> whereExpression, Expression<Func<TEntity, TResult>> expression); + + Task<TResult> QueryFirstAsync<TResult>(Expression<Func<TEntity, bool>> whereExpression, Expression<Func<TEntity, TResult>> expression); + + TResult QueryFirst<TResult>(Expression<Func<TEntity, bool>> whereExpression, Expression<Func<TEntity, TResult>> expression, Dictionary<string, OrderByType> orderBy); + + Task<TResult> QueryFirstAsync<TResult>(Expression<Func<TEntity, bool>> whereExpression, Expression<Func<TEntity, TResult>> expression, Dictionary<string, OrderByType> orderBy); + + TEntity QueryFirst(Expression<Func<TEntity, bool>> whereExpression, Dictionary<string, OrderByType> orderBy); + + Task<TEntity> QueryFirstAsync(Expression<Func<TEntity, bool>> whereExpression, Dictionary<string, OrderByType> orderBy); + + /// <summary> + /// 鏉′欢鏌ヨ鏁版嵁骞舵帓搴� + /// </summary> + /// <param name="whereExpression"></param> + /// <param name="orderByFields"></param> + /// <returns></returns> + List<TEntity> QueryData(Expression<Func<TEntity, bool>> whereExpression, Dictionary<string, OrderByType> orderBy); + + Task<List<TEntity>> QueryDataAsync(Expression<Func<TEntity, bool>> whereExpression, string orderByFields); + + /// <summary> + /// 鏉′欢鏌ヨ鏁版嵁骞舵帓搴� + /// </summary> + /// <param name="whereExpression"></param> + /// <param name="where"></param> + /// <returns></returns> + List<TEntity> QueryData(string where, Dictionary<string, OrderByType> orderBy); + + Task<List<TEntity>> QueryDataAsync(string where, Dictionary<string, OrderByType> orderBy); + + /// <summary> + /// 鏌ヨ鎸囧畾鏁版嵁瀵硅薄 + /// </summary> + /// <typeparam name="TResult"></typeparam> + /// <param name="expression"></param> + /// <returns></returns> + List<TResult> QueryData<TResult>(Expression<Func<TEntity, TResult>> expression); + + Task<List<TResult>> QueryDataAsync<TResult>(Expression<Func<TEntity, TResult>> expression); + + /// <summary> + /// 鏉′欢鏌ヨ鎸囧畾鏁版嵁瀵硅薄 + /// </summary> + /// <typeparam name="TResult"></typeparam> + /// <param name="expression"></param> + /// <param name="whereExpression"></param> + /// <param name="orderByFields"></param> + /// <returns></returns> + List<TResult> QueryData<TResult>(Expression<Func<TEntity, TResult>> expression, Expression<Func<TEntity, bool>> whereExpression, string orderByFields = ""); + + Task<List<TResult>> QueryDataAsync<TResult>(Expression<Func<TEntity, TResult>> expression, Expression<Func<TEntity, bool>> whereExpression, string orderByFields); + + /// <summary> + /// 鏉′欢鏌ヨ鏁版嵁骞舵帓搴� + /// </summary> + /// <param name="whereExpression"></param> + /// <param name="orderByExpression"></param> + /// <param name="isAsc"></param> + /// <returns></returns> + List<TEntity> QueryData(Expression<Func<TEntity, bool>> whereExpression, Expression<Func<TEntity, object>> orderByExpression, bool isAsc = true); + + Task<List<TEntity>> QueryDataAsync(Expression<Func<TEntity, bool>> whereExpression, Expression<Func<TEntity, object>> orderByExpression, bool isAsc = true); + + /// <summary> + /// 鏉′欢鏌ヨ鏁版嵁骞舵帓搴� + /// </summary> + /// <param name="where"></param> + /// <param name="orderByFields"></param> + /// <returns></returns> + List<TEntity> QueryData(string where, string orderByFields); + + Task<List<TEntity>> QueryDataAsync(string where, string orderByFields); + + /// <summary> + /// 鍘熺敓Sql璇彞鏌ヨ鏁版嵁 + /// </summary> + /// <param name="sql"></param> + /// <param name="parameters"></param> + /// <returns></returns> + List<TEntity> QueryDataBySql(string sql, SugarParameter[]? parameters = null); + + Task<List<TEntity>> QueryDataBySqlAsync(string sql, SugarParameter[]? parameters = null); + + /// <summary> + /// 鍘熺敓Sql璇彞鏌ヨ鏁版嵁 + /// </summary> + /// <param name="sql"></param> + /// <param name="parameters"></param> + /// <returns></returns> + List<dynamic> QueryDynamicDataBySql(string sql, SugarParameter[]? parameters = null); + + Task<List<dynamic>> QueryDynamicDataBySqlAsync(string sql, SugarParameter[]? parameters = null); + + List<object> QueryObjectDataBySql(string sql, SugarParameter[]? parameters = null); + + Task<List<object>> QueryObjectDataBySqlAsync(string sql, SugarParameter[]? parameters = null); + + /// <summary> + /// 鍘熺敓Sql璇彞鎵ц鎿嶄綔 + /// </summary> + /// <param name="sql"></param> + /// <param name="sqlParameters"></param> + /// <returns></returns> + int ExecuteSqlCommand(string sql, params SqlParameter[] sqlParameters); + + Task<int> ExecuteSqlCommandAsync(string sql, params SqlParameter[] sqlParameters); + + /// <summary> + /// 鍘熺敓Sql璇彞鏌ヨ鏁版嵁 + /// </summary> + /// <param name="sql"></param> + /// <param name="parameters"></param> + /// <returns></returns> + DataTable QueryTable(string sql, SugarParameter[]? parameters = null); + + Task<DataTable> QueryTableAsync(string sql, SugarParameter[]? parameters = null); + + /// <summary> + /// 鏉′欢鏌ヨ鏁版嵁鎸囧畾鏁伴噺鐨勮 + /// </summary> + /// <param name="whereExpression"></param> + /// <param name="top"></param> + /// <param name="orderByFields"></param> + /// <returns></returns> + List<TEntity> QueryData(Expression<Func<TEntity, bool>> whereExpression, int top, string orderByFields); + + Task<List<TEntity>> QueryDataAsync(Expression<Func<TEntity, bool>> whereExpression, int top, string orderByFields); + + /// <summary> + /// 鏉′欢鏌ヨ鎸囧畾鏁伴噺鐨勮 + /// </summary> + /// <param name="where"></param> + /// <param name="top"></param> + /// <param name="orderByFields"></param> + /// <returns></returns> + List<TEntity> QueryData(string where, int top, string orderByFields); + + Task<List<TEntity>> QueryDataAsync(string where, int top, string orderByFields); + + /// <summary> + /// 鍒嗛〉鏌ヨ + /// </summary> + /// <param name="whereExpression"></param> + /// <param name="pageIndex"></param> + /// <param name="pageSize"></param> + /// <param name="orderByFields"></param> + /// <returns></returns> + List<TEntity> QueryData(Expression<Func<TEntity, bool>> whereExpression, int pageIndex, int pageSize, string orderByFields); + + Task<List<TEntity>> QueryDataAsync(Expression<Func<TEntity, bool>> whereExpression, int pageIndex, int pageSize, string orderByFields); + + /// <summary> + /// 鍒嗛〉鏌ヨ + /// </summary> + /// <param name="where"></param> + /// <param name="pageIndex"></param> + /// <param name="pageSize"></param> + /// <param name="orderByFields"></param> + /// <returns></returns> + List<TEntity> QueryData(string where, int pageIndex, int pageSize, string orderByFields); + + Task<List<TEntity>> QueryDataAsync(string where, int pageIndex, int pageSize, string orderByFields); + + /// <summary> + /// 鍒嗛〉鏌ヨ + /// </summary> + /// <param name="whereExpression"></param> + /// <param name="pageIndex"></param> + /// <param name="pageSize"></param> + /// <param name="orderByFields"></param> + /// <returns></returns> + PageGridData<TEntity> QueryPage(Expression<Func<TEntity, bool>> whereExpression, int pageIndex, int pageSize, string? orderByFields = null); + + /// <summary> + /// 鍒嗛〉鏌ヨ + /// </summary> + /// <param name="whereExpression"></param> + /// <param name="pageIndex"></param> + /// <param name="pagesize"></param> + /// <param name="orderBy"></param> + /// <returns></returns> + PageGridData<TEntity> QueryPage(Expression<Func<TEntity, bool>> whereExpression, int pageIndex, int pagesize, Dictionary<string, OrderByType> orderBy); + + PageGridData<TEntity> QueryPage(string where, int pageIndex, int pageSize, Dictionary<string, OrderByType> orderBy); + + /// <summary> + /// 涓よ〃鑱旀煡 + /// </summary> + /// <typeparam name="T"></typeparam> + /// <typeparam name="T2"></typeparam> + /// <typeparam name="TResult"></typeparam> + /// <param name="joinExpression"></param> + /// <param name="selectExpression"></param> + /// <param name="whereExpression"></param> + /// <returns></returns> + List<TResult> QueryTabs<T, T2, TResult>( + Expression<Func<T, T2, object[]>> joinExpression, + Expression<Func<T, T2, TResult>> selectExpression, + Expression<Func<T, T2, bool>> whereExpressionT1, + Expression<Func<TResult, bool>> whereExpression); + + Task<List<TResult>> QueryTabsAsync<T, T2, TResult>( + Expression<Func<T, T2, object[]>> joinExpression, + Expression<Func<T, T2, TResult>> selectExpression, + Expression<Func<TResult, bool>> whereExpression); + + /// <summary> + /// 涓よ〃鑱旀煡-鍒嗛〉 + /// </summary> + /// <typeparam name="T"></typeparam> + /// <typeparam name="T2"></typeparam> + /// <typeparam name="TResult"></typeparam> + /// <param name="joinExpression"></param> + /// <param name="selectExpression"></param> + /// <param name="whereExpression"></param> + /// <param name="pageIndex"></param> + /// <param name="pageSize"></param> + /// <param name="orderByFields"></param> + /// <returns></returns> + PageGridData<TResult> QueryTabsPage<T, T2, TResult>( + Expression<Func<T, T2, object[]>> joinExpression, + Expression<Func<T, T2, TResult>> selectExpression, + Expression<Func<TResult, bool>> whereExpression, + int pageIndex = 1, + int pageSize = 20, + string? orderByFields = null); + + /// <summary> + /// 涓よ〃鑱斿悎鏌ヨ-鍒嗛〉-鍒嗙粍 + /// </summary> + /// <typeparam name="T"></typeparam> + /// <typeparam name="T2"></typeparam> + /// <typeparam name="TResult"></typeparam> + /// <param name="joinExpression"></param> + /// <param name="selectExpression"></param> + /// <param name="whereExpression"></param> + /// <param name="groupExpression"></param> + /// <param name="pageIndex"></param> + /// <param name="pageSize"></param> + /// <param name="orderByFields"></param> + /// <returns></returns> + PageGridData<TResult> QueryTabsPage<T, T2, TResult>( + Expression<Func<T, T2, object[]>> joinExpression, + Expression<Func<T, T2, TResult>> selectExpression, + Expression<Func<TResult, bool>> whereExpression, + Expression<Func<T, object>> groupExpression, + int pageIndex = 1, + int pageSize = 20, + string? orderByFields = null); + + //List<TResult> QueryMuch<T, T2, T3, TResult>( + // Expression<Func<T, T2, T3, object[]>> joinExpression, + // Expression<Func<T, T2, T3, TResult>> selectExpression, + // Expression<Func<T, T2, T3, bool>> whereLambda = null) where T : class, new(); + //Task<PageModel<TEntity>> QueryPage(PaginationModel pagination); + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/BaseRepository/RepositoryBase.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/BaseRepository/RepositoryBase.cs" new file mode 100644 index 0000000..ee96461 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/BaseRepository/RepositoryBase.cs" @@ -0,0 +1,899 @@ +锘縰sing SqlSugar; +using System.Data; +using System.Linq.Expressions; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Reflection; +using WIDESEA_Core.Helper; +using Microsoft.Data.SqlClient; +using System.Drawing.Printing; +using WIDESEA_Core.Tenants; +using WIDESEA_Core.Seed; +using WIDESEA_Core.DB; +using WIDESEA_Core.Const; +using WIDESEA_Core.AOP; +using AngleSharp.Dom; +using OfficeOpenXml.FormulaParsing.Excel.Functions.Text; +using SharpCompress.Common; + +namespace WIDESEA_Core.BaseRepository +{ + public class RepositoryBase<TEntity> : IRepository<TEntity> where TEntity : class, new() + { + private readonly IUnitOfWorkManage _unitOfWorkManage; + private readonly SqlSugarClient _dbBase; + + private ISqlSugarClient _db + { + get + { + ISqlSugarClient db = _dbBase; + + //澶氱鎴� + var mta = typeof(TEntity).GetCustomAttribute<MultiTenantAttribute>(); + if (mta is { TenantType: TenantTypeEnum.Db }) + { + //鑾峰彇绉熸埛淇℃伅 绉熸埛淇℃伅鍙互鎻愬墠缂撳瓨涓嬫潵 + if (App.User is { TenantId: > 0 }) + { + dynamic tenant = db.Queryable(MainDb.TenantTableName, "x").Where(MainDb.TenantId, "=", App.User.TenantId).First(); + if (tenant != null) + { + var iTenant = db.AsTenant(); + if (!iTenant.IsAnyConnection(tenant.TenantId)) + { + string conStr = tenant.ConnectionString; + ConnectionConfig connectionConfig = new ConnectionConfig() + { + ConfigId = tenant.TenantId, + ConnectionString = conStr.DecryptDES(AppSecret.DB), + DbType = (SqlSugar.DbType)tenant.DbType, + IsAutoCloseConnection = true, + AopEvents = new AopEvents() + { + DataExecuting = SqlSugarAop.DataExecuting + } + }; + iTenant.AddConnection(connectionConfig); + } + + return iTenant.GetConnection(tenant.TenantId); + } + } + } + + return db; + } + } + + public ISqlSugarClient Db => _db; + + public RepositoryBase(IUnitOfWorkManage unitOfWorkManage) + { + _unitOfWorkManage = unitOfWorkManage; + _dbBase = unitOfWorkManage.GetDbClient(); + } + + /// <summary> + /// 閫氳繃涓婚敭鏌ヨ鏁版嵁 + /// </summary> + /// <param name="id">涓婚敭</param> + /// <returns>鏌ヨ缁撴灉</returns> + public virtual TEntity QureyDataById(object id) + { + return _db.Queryable<TEntity>().In(id).Single(); + } + + /// <summary> + /// 閫氳繃涓婚敭鏁扮粍鏌ヨ鏁版嵁 + /// </summary> + /// <param name="lstIds">涓婚敭鏁扮粍</param> + /// <returns>鏌ヨ缁撴灉闆嗗悎</returns> + public virtual List<TEntity> QureyDataByIds(object[] lstIds) + { + return _db.Queryable<TEntity>().In(lstIds).ToList(); + } + + /// <summary> + /// 閫氳繃涓婚敭闆嗗悎鏌ヨ鏁版嵁 + /// </summary> + /// <param name="lstIds">涓婚敭闆嗗悎</param> + /// <returns>鏌ヨ缁撴灉闆嗗悎</returns> + public virtual List<TEntity> QureyDataByIds(List<object> lstIds) + { + return _db.Queryable<TEntity>().In(lstIds).ToList(); + } + + /// <summary> + /// 娣诲姞鍗曟潯鏁版嵁 + /// </summary> + /// <param name="entity"></param> + /// <returns>褰卞搷琛屾暟</returns> + public virtual int AddData(TEntity entity) + { + IInsertable<TEntity> insert = _db.Insertable(entity); + return insert.ExecuteReturnIdentity(); + } + + /// <summary> + /// 娣诲姞澶氭潯鏁版嵁 + /// </summary> + /// <param name="listEntity"></param> + /// <returns>褰卞搷琛屾暟</returns> + public virtual int AddData(List<TEntity> listEntity) + { + IInsertable<TEntity> insert = _db.Insertable(listEntity); + return insert.ExecuteReturnIdentity(); + } + + /// <summary> + /// 閫氳繃涓婚敭鍒犻櫎鏁版嵁 + /// </summary> + /// <param name="id">涓婚敭</param> + /// <returns>鍒犻櫎缁撴灉</returns> + public virtual bool DeleteDataById(object id) + { + return _db.Deleteable<TEntity>().In(id).ExecuteCommandHasChange(); + } + + /// <summary> + /// 閫氳繃涓婚敭鏁版嵁鍒犻櫎澶氭潯鏁版嵁 + /// </summary> + /// <param name="ids">涓婚敭鏁扮粍</param> + /// <returns>鍒犻櫎缁撴灉</returns> + public virtual bool DeleteDataByIds(object[] ids) + { + return _db.Deleteable<TEntity>().In(ids).ExecuteCommandHasChange(); + } + + /// <summary> + /// 閫氳繃瀹炰綋鏁版嵁鍒犻櫎鏁版嵁 + /// </summary> + /// <param name="ids">涓婚敭鏁扮粍</param> + /// <returns>鍒犻櫎缁撴灉</returns> + public virtual bool DeleteData(TEntity entity) + { + return _db.Deleteable(entity).ExecuteCommandHasChange(); + } + + /// <summary> + /// 閫氳繃瀹炰綋闆嗗悎鏁版嵁鍒犻櫎鏁版嵁 + /// </summary> + /// <param name="ids">涓婚敭鏁扮粍</param> + /// <returns>鍒犻櫎缁撴灉</returns> + public virtual bool DeleteData(List<TEntity> listEntity) + { + return _db.Deleteable(listEntity).ExecuteCommandHasChange(); + } + + /// <summary> + /// 鏇存柊鍗曟潯鏁版嵁 + /// </summary> + /// <param name="entity"></param> + /// <returns></returns> + public virtual bool UpdateData(TEntity entity) + { + return _db.Updateable(entity).ExecuteCommandHasChange(); + } + + /// <summary> + /// 鏇存柊澶氭潯鏁版嵁 + /// </summary> + /// <param name="listEntity"></param> + /// <returns></returns> + public virtual bool UpdateData(List<TEntity> listEntity) + { + return _db.Updateable(listEntity).ExecuteCommandHasChange(); + } + + /// <summary> + /// 鎸囧畾鍒楁洿鏂版暟鎹� + /// </summary> + /// <param name="entity"></param> + /// <param name="lstColumns"></param> + /// <param name="lstIgnoreColumns"></param> + /// <returns></returns> + public virtual bool UpdateData(TEntity entity, List<string> lstColumns, List<string> lstIgnoreColumns = null) + { + IUpdateable<TEntity> update = _db.Updateable(entity); + + if (lstIgnoreColumns != null && lstIgnoreColumns.Count > 0) + { + update = update.IgnoreColumns(lstIgnoreColumns.ToArray()); + } + + if (lstColumns != null && lstColumns.Count > 0) + { + update = update.UpdateColumns(lstColumns.ToArray()); + } + + return update.ExecuteCommandHasChange(); + } + + /// <summary> + /// 鏌ヨ鎵�鏈夋暟鎹� + /// </summary> + /// <returns></returns> + public virtual List<TEntity> QueryData() + { + return _db.Queryable<TEntity>().ToList(); + } + + /// <summary> + /// 鏉′欢鏌ヨ鏁版嵁 + /// </summary> + /// <param name="where"></param> + /// <returns></returns> + public virtual List<TEntity> QueryData(string where) + { + return _db.Queryable<TEntity>().WhereIF(!string.IsNullOrEmpty(where), where).ToList(); + } + + /// <summary> + /// 鏉′欢鏌ヨ鏁版嵁 + /// </summary> + /// <param name="whereExpression"></param> + /// <returns></returns> + public virtual List<TEntity> QueryData(Expression<Func<TEntity, bool>> whereExpression) + { + return _db.Queryable<TEntity>().WhereIF(whereExpression != null, whereExpression).ToList(); + } + + public virtual TEntity QueryFirst(Expression<Func<TEntity, bool>> whereExpression) + { + return _db.Queryable<TEntity>().WhereIF(whereExpression != null, whereExpression).First(); + } + + public virtual TResult QueryFirst<TResult>(Expression<Func<TEntity, bool>> whereExpression, Expression<Func<TEntity, TResult>> expression) + { + return _db.Queryable<TEntity>().WhereIF(whereExpression != null, whereExpression).Select(expression).First(); + } + + /// <summary> + /// 鏉′欢鏌ヨ鏁版嵁骞舵帓搴� + /// </summary> + /// <param name="whereExpression"></param> + /// <param name="orderByFields"></param> + /// <returns></returns> + public virtual List<TEntity> QueryData(Expression<Func<TEntity, bool>> whereExpression, string orderByFields) + { + return _db.Queryable<TEntity>().WhereIF(whereExpression != null, whereExpression).OrderByIF(!string.IsNullOrEmpty(orderByFields), orderByFields).ToList(); + } + + /// <summary> + /// 鏉′欢鏌ヨ鏁版嵁骞舵帓搴� + /// </summary> + /// <param name="where"></param> + /// <param name="orderBy"></param> + /// <returns></returns> + public virtual List<TEntity> QueryData(string where, Dictionary<string, OrderByType> orderBy) + { + List<OrderByModel> orderByModels = new List<OrderByModel>(); + foreach (var item in orderBy) + { + OrderByModel orderByModel = new OrderByModel() + { + FieldName = item.Key, + OrderByType = item.Value + }; + orderByModels.Add(orderByModel); + } + return _db.Queryable<TEntity>().WhereIF(!string.IsNullOrEmpty(where), where).OrderBy(orderByModels).ToList(); + } + + /// <summary> + /// 鏌ヨ鎸囧畾鏁版嵁瀵硅薄 + /// </summary> + /// <typeparam name="TResult"></typeparam> + /// <param name="expression"></param> + /// <returns></returns> + public virtual List<TResult> QueryData<TResult>(Expression<Func<TEntity, TResult>> expression) + { + return _db.Queryable<TEntity>().Select(expression).ToList(); + } + + /// <summary> + /// 鏉′欢鏌ヨ鎸囧畾鏁版嵁瀵硅薄 + /// </summary> + /// <typeparam name="TResult"></typeparam> + /// <param name="expression"></param> + /// <param name="whereExpression"></param> + /// <param name="orderByFields"></param> + /// <returns></returns> + public virtual List<TResult> QueryData<TResult>(Expression<Func<TEntity, TResult>> expression, Expression<Func<TEntity, bool>> whereExpression, string orderByFields) + { + return _db.Queryable<TEntity>().OrderByIF(!string.IsNullOrEmpty(orderByFields), orderByFields).WhereIF(whereExpression != null, whereExpression).Select(expression).ToList(); + } + + /// <summary> + /// 鏉′欢鏌ヨ鏁版嵁骞舵帓搴� + /// </summary> + /// <param name="whereExpression"></param> + /// <param name="orderByExpression"></param> + /// <param name="isAsc"></param> + /// <returns></returns> + public virtual List<TEntity> QueryData(Expression<Func<TEntity, bool>> whereExpression, Expression<Func<TEntity, object>> orderByExpression, bool isAsc = true) + { + return _db.Queryable<TEntity>().OrderByIF(orderByExpression != null, orderByExpression, isAsc ? OrderByType.Asc : OrderByType.Desc).WhereIF(whereExpression != null, whereExpression).ToList(); + } + + /// <summary> + /// 鏉′欢鏌ヨ鏁版嵁骞舵帓搴� + /// </summary> + /// <param name="where"></param> + /// <param name="orderByFields"></param> + /// <returns></returns> + public virtual List<TEntity> QueryData(string where, string orderByFields) + { + return _db.Queryable<TEntity>().OrderByIF(!string.IsNullOrEmpty(orderByFields), orderByFields).WhereIF(!string.IsNullOrEmpty(where), where).ToList(); + } + + /// <summary> + /// 鍘熺敓Sql璇彞鏌ヨ鏁版嵁 + /// </summary> + /// <param name="sql"></param> + /// <param name="parameters"></param> + /// <returns></returns> + public virtual List<TEntity> QueryDataBySql(string sql, SugarParameter[] parameters = null) + { + return _db.Ado.SqlQuery<TEntity>(sql, parameters); + } + + /// <summary> + /// 鍘熺敓Sql璇彞鏌ヨ鏁版嵁 + /// </summary> + /// <param name="sql"></param> + /// <param name="parameters"></param> + /// <returns></returns> + public virtual List<dynamic> QueryDynamicDataBySql(string sql, SugarParameter[] parameters = null) + { + return _db.Ado.SqlQuery<dynamic>(sql, parameters); + } + + /// <summary> + /// 鍘熺敓Sql璇彞鏌ヨ鏁版嵁 + /// </summary> + /// <param name="sql"></param> + /// <param name="parameters"></param> + /// <returns></returns> + public virtual List<object> QueryObjectDataBySql(string sql, SugarParameter[] parameters = null) + { + return _db.Ado.SqlQuery<object>(sql, parameters); + } + + /// <summary> + /// 鍘熺敓Sql璇彞鎵ц鎿嶄綔 + /// </summary> + /// <param name="sql"></param> + /// <param name="sqlParameters"></param> + /// <returns></returns> + public virtual int ExecuteSqlCommand(string sql, params SqlParameter[] sqlParameters) + { + return _db.Ado.ExecuteCommand(sql, sqlParameters); + } + + /// <summary> + /// 鍘熺敓Sql璇彞鏌ヨ鏁版嵁 + /// </summary> + /// <param name="sql"></param> + /// <param name="parameters"></param> + /// <returns></returns> + public virtual DataTable QueryTable(string sql, SugarParameter[] parameters = null) + { + return _db.Ado.GetDataTable(sql, parameters); + } + + /// <summary> + /// 鏉′欢鏌ヨ鏁版嵁鎸囧畾鏁伴噺鐨勮 + /// </summary> + /// <param name="whereExpression"></param> + /// <param name="top"></param> + /// <param name="orderByFields"></param> + /// <returns></returns> + public virtual List<TEntity> QueryData(Expression<Func<TEntity, bool>> whereExpression, int top, string orderByFields) + { + return _db.Queryable<TEntity>().OrderByIF(!string.IsNullOrEmpty(orderByFields), orderByFields).WhereIF(whereExpression != null, whereExpression).Take(top).IncludesAllFirstLayer().ToList(); + } + + /// <summary> + /// 鏉′欢鏌ヨ鎸囧畾鏁伴噺鐨勮 + /// </summary> + /// <param name="where"></param> + /// <param name="top"></param> + /// <param name="orderByFields"></param> + /// <returns></returns> + public virtual List<TEntity> QueryData(string where, int top, string orderByFields) + { + return _db.Queryable<TEntity>().OrderByIF(!string.IsNullOrEmpty(orderByFields), orderByFields).WhereIF(!string.IsNullOrEmpty(where), where).Take(top).IncludesAllFirstLayer().ToList(); + } + + /// <summary> + /// 鍒嗛〉鏌ヨ + /// </summary> + /// <param name="whereExpression"></param> + /// <param name="pageIndex"></param> + /// <param name="pageSize"></param> + /// <param name="orderByFields"></param> + /// <returns></returns> + public virtual List<TEntity> QueryData(Expression<Func<TEntity, bool>> whereExpression, int pageIndex, int pageSize, string orderByFields) + { + return _db.Queryable<TEntity>().OrderByIF(!string.IsNullOrEmpty(orderByFields), orderByFields) + .WhereIF(whereExpression != null, whereExpression).ToPageList(pageIndex, pageSize); + } + + /// <summary> + /// 鍒嗛〉鏌ヨ + /// </summary> + /// <param name="where"></param> + /// <param name="pageIndex"></param> + /// <param name="pageSize"></param> + /// <param name="orderByFields"></param> + /// <returns></returns> + public virtual List<TEntity> QueryData(string where, int pageIndex, int pageSize, string orderByFields) + { + return _db.Queryable<TEntity>().OrderByIF(!string.IsNullOrEmpty(orderByFields), orderByFields) + .WhereIF(!string.IsNullOrEmpty(where), where).IncludesAllFirstLayer().ToPageList(pageIndex, pageSize); + } + + /// <summary> + /// 鍒嗛〉鏌ヨ + /// </summary> + /// <param name="whereExpression"></param> + /// <param name="pageIndex"></param> + /// <param name="pageSize"></param> + /// <param name="orderByFields"></param> + /// <returns></returns> + public virtual PageGridData<TEntity> QueryPage(Expression<Func<TEntity, bool>> whereExpression, int pageIndex, int pageSize, string orderByFields = null) + { + int totalCount = 0; + var list = _db.Queryable<TEntity>() + .OrderByIF(!string.IsNullOrEmpty(orderByFields), orderByFields) + .WhereIF(whereExpression != null, whereExpression) + .IncludesAllFirstLayer() + .ToPageList(pageIndex, pageSize, ref totalCount); + + return new PageGridData<TEntity> { Rows = list, Total = totalCount }; + } + + /// <summary> + /// 鍒嗛〉鏌ヨ + /// </summary> + /// <param name="whereExpression"></param> + /// <param name="pageIndex"></param> + /// <param name="pageSize"></param> + /// <param name="orderBy"></param> + /// <returns></returns> + public virtual PageGridData<TEntity> QueryPage(Expression<Func<TEntity, bool>> whereExpression, int pageIndex, int pageSize, Dictionary<string, OrderByType> orderBy) + { + List<OrderByModel> orderByModels = new List<OrderByModel>(); + foreach (var item in orderBy) + { + OrderByModel orderByModel = new OrderByModel() + { + FieldName = item.Key, + OrderByType = item.Value + }; + orderByModels.Add(orderByModel); + } + int totalCount = 0; + List<TEntity> list = _db.Queryable<TEntity>() + .OrderBy(orderByModels) + .WhereIF(whereExpression != null, whereExpression) + .IncludesAllFirstLayer() + .ToPageList(pageIndex, pageSize, ref totalCount); + + return new PageGridData<TEntity>(totalCount, list); + } + + /// <summary> + /// 鍒嗛〉鏌ヨ + /// </summary> + /// <param name="where"></param> + /// <param name="pageIndex"></param> + /// <param name="pageSize"></param> + /// <param name="orderByFields"></param> + /// <returns></returns> + public virtual PageGridData<TEntity> QueryPage(string where, int pageIndex, int pageSize, Dictionary<string, OrderByType> orderBy) + { + List<OrderByModel> orderByModels = new List<OrderByModel>(); + foreach (var item in orderBy) + { + OrderByModel orderByModel = new OrderByModel() + { + FieldName = item.Key, + OrderByType = item.Value + }; + orderByModels.Add(orderByModel); + } + int totalCount = 0; + List<TEntity> list = _db.Queryable<TEntity>() + .WhereIF(!string.IsNullOrEmpty(where), where).OrderBy(orderByModels).IncludesAllFirstLayer().ToPageList(pageIndex, pageSize, ref totalCount); + + return new PageGridData<TEntity>(totalCount, list); + } + + /// <summary> + /// 涓よ〃鑱旀煡 + /// </summary> + /// <typeparam name="T"></typeparam> + /// <typeparam name="T2"></typeparam> + /// <typeparam name="TResult"></typeparam> + /// <param name="joinExpression"></param> + /// <param name="selectExpression"></param> + /// <param name="whereExpression"></param> + /// <returns></returns> + public virtual List<TResult> QueryTabs<T, T2, TResult>( + Expression<Func<T, T2, object[]>> joinExpression, + Expression<Func<T, T2, TResult>> selectExpression, + Expression<Func<T, T2, bool>> whereExpressionT1, + Expression<Func<TResult, bool>> whereExpression) + { + List<TResult> list = _db.Queryable(joinExpression).WhereIF(whereExpressionT1 != null, whereExpressionT1) + .Select(selectExpression) + .WhereIF(whereExpression != null, whereExpression).ToList(); + return list; + } + + /// <summary> + /// 涓よ〃鑱旀煡-鍒嗛〉 + /// </summary> + /// <typeparam name="T1"></typeparam> + /// <typeparam name="T2"></typeparam> + /// <typeparam name="TResult"></typeparam> + /// <param name="joinExpression"></param> + /// <param name="selectExpression"></param> + /// <param name="whereExpression"></param> + /// <param name="pageIndex"></param> + /// <param name="pageSize"></param> + /// <param name="orderByFields"></param> + public virtual PageGridData<TResult> QueryTabsPage<T1, T2, TResult>(Expression<Func<T1, T2, object[]>> joinExpression, Expression<Func<T1, T2, TResult>> selectExpression, Expression<Func<TResult, bool>> whereExpression, int pageIndex, int pageSize, string orderByFields = null) + { + int totalCount = 0; + List<TResult> list = _db.Queryable(joinExpression) + .Select(selectExpression) + .OrderByIF(!string.IsNullOrEmpty(orderByFields), orderByFields) + .WhereIF(whereExpression != null, whereExpression) + .ToPageList(pageIndex, pageSize, ref totalCount); + return new PageGridData<TResult>(totalCount, list); + } + + /// <summary> + /// 涓よ〃鑱斿悎鏌ヨ-鍒嗛〉-鍒嗙粍 + /// </summary> + /// <typeparam name="T"></typeparam> + /// <typeparam name="T2"></typeparam> + /// <typeparam name="TResult"></typeparam> + /// <param name="joinExpression"></param> + /// <param name="selectExpression"></param> + /// <param name="whereExpression"></param> + /// <param name="groupExpression"></param> + /// <param name="pageIndex"></param> + /// <param name="pageSize"></param> + /// <param name="orderByFields"></param> + /// <returns></returns> + public virtual PageGridData<TResult> QueryTabsPage<T1, T2, TResult>(Expression<Func<T1, T2, object[]>> joinExpression, Expression<Func<T1, T2, TResult>> selectExpression, Expression<Func<TResult, bool>> whereExpression, Expression<Func<T1, object>> groupExpression, int pageIndex, int pageSize, string orderByFields = null) + { + int totalCount = 0; + List<TResult> list = _db.Queryable(joinExpression).GroupBy(groupExpression) + .Select(selectExpression) + .OrderByIF(!string.IsNullOrEmpty(orderByFields), orderByFields) + .WhereIF(whereExpression != null, whereExpression) + .ToPageList(pageIndex, pageSize, ref totalCount); + return new PageGridData<TResult>(totalCount, list); + } + + //List<TResult> QueryMuch<T, T2, T3, TResult>( + // Expression<Func<T, T2, T3, object[]>> joinExpression, + // Expression<Func<T, T2, T3, TResult>> selectExpression, + // Expression<Func<T, T2, T3, bool>> whereLambda = null) where T : class, new(){throw new NotImplementedException();} + //Task<PageModel<TEntity>> QueryPage(PaginationModel pagination){throw new NotImplementedException();} + + public Task<TEntity> QureyDataByIdAsync(object id) + { + return _db.Queryable<TEntity>().In(id).SingleAsync(); + } + + public Task<List<TEntity>> QureyDataByIdsAsync(object[] lstIds) + { + return _db.Queryable<TEntity>().In(lstIds).ToListAsync(); + } + + public Task<List<TEntity>> QureyDataByIdsAsync(List<object> lstIds) + { + return _db.Queryable<TEntity>().In(lstIds).ToListAsync(); + } + + public Task<int> AddDataAsync(TEntity entity) + { + IInsertable<TEntity> insert = _db.Insertable(entity); + return insert.ExecuteReturnIdentityAsync(); + } + + /// <summary> + /// 瀵艰埅鎻掑叆鏁版嵁(鍙敮鎸�2绾�) + /// </summary> + /// <param name="Entity"></param> + /// <returns></returns> + public async Task<bool> AddDataNavAsync(TEntity Entity) + { + return await _db.InsertNav(Entity).IncludesAllFirstLayer().ExecuteCommandAsync(); + } + + public Task<int> AddDataAsync(List<TEntity> listEntity) + { + IInsertable<TEntity> insert = _db.Insertable(listEntity); + return insert.ExecuteReturnIdentityAsync(); + } + + public Task<bool> DeleteDataByIdAsync(object id) + { + return _db.Deleteable<TEntity>().In(id).ExecuteCommandHasChangeAsync(); + } + + public Task<bool> DeleteDataByIdsAsync(object[] ids) + { + return _db.Deleteable<TEntity>().In(ids).ExecuteCommandHasChangeAsync(); + } + + public Task<bool> DeleteDataAsync(TEntity entity) + { + return _db.Deleteable(entity).ExecuteCommandHasChangeAsync(); + } + + public Task<bool> DeleteDataAsync(List<TEntity> listEntity) + { + return _db.Deleteable(listEntity).ExecuteCommandHasChangeAsync(); + } + + public Task<bool> UpdateDataAsync(TEntity entity) + { + return _db.Updateable(entity).ExecuteCommandHasChangeAsync(); + } + + public Task<bool> UpdateDataAsync(List<TEntity> listEntity) + { + return _db.Updateable(listEntity).ExecuteCommandHasChangeAsync(); + } + + public Task<bool> UpdateDataAsync(TEntity entity, List<string> lstColumns, List<string>? lstIgnoreColumns = null) + { + IUpdateable<TEntity> update = _db.Updateable(entity); + + if (lstIgnoreColumns != null && lstIgnoreColumns.Count > 0) + { + update = update.IgnoreColumns(lstIgnoreColumns.ToArray()); + } + + if (lstColumns != null && lstColumns.Count > 0) + { + update = update.UpdateColumns(lstColumns.ToArray()); + } + + return update.ExecuteCommandHasChangeAsync(); + } + + public Task<List<TEntity>> QueryDataAsync() + { + return _db.Queryable<TEntity>().ToListAsync(); + } + + public Task<List<TEntity>> QueryDataAsync(string where) + { + return _db.Queryable<TEntity>().WhereIF(!string.IsNullOrEmpty(where), where).ToListAsync(); + } + + public Task<List<TEntity>> QueryDataAsync(Expression<Func<TEntity, bool>> whereExpression) + { + return _db.Queryable<TEntity>().WhereIF(whereExpression != null, whereExpression).ToListAsync(); + } + + public Task<TEntity> QueryFirstAsync(Expression<Func<TEntity, bool>> whereExpression) + { + return _db.Queryable<TEntity>().WhereIF(whereExpression != null, whereExpression).FirstAsync(); + } + + public Task<TEntity> QueryFirstNavAsync(Expression<Func<TEntity, bool>> whereExpression) + { + return _db.Queryable<TEntity>().WhereIF(whereExpression != null, whereExpression).IncludesAllFirstLayer().FirstAsync(); + } + + public Task<TResult> QueryFirstAsync<TResult>(Expression<Func<TEntity, bool>> whereExpression, Expression<Func<TEntity, TResult>> expression) + { + return _db.Queryable<TEntity>().WhereIF(whereExpression != null, whereExpression).Select(expression).FirstAsync(); + } + + public TResult QueryFirst<TResult>(Expression<Func<TEntity, bool>> whereExpression, Expression<Func<TEntity, TResult>> expression, Dictionary<string, OrderByType> orderBy) + { + List<OrderByModel> orderByModels = new List<OrderByModel>(); + foreach (var item in orderBy) + { + OrderByModel orderByModel = new OrderByModel() + { + FieldName = item.Key, + OrderByType = item.Value + }; + orderByModels.Add(orderByModel); + } + return _db.Queryable<TEntity>().WhereIF(whereExpression != null, whereExpression).OrderBy(orderByModels).Select(expression).First(); + } + + public Task<TResult> QueryFirstAsync<TResult>(Expression<Func<TEntity, bool>> whereExpression, Expression<Func<TEntity, TResult>> expression, Dictionary<string, OrderByType> orderBy) + { + List<OrderByModel> orderByModels = new List<OrderByModel>(); + foreach (var item in orderBy) + { + OrderByModel orderByModel = new OrderByModel() + { + FieldName = item.Key, + OrderByType = item.Value + }; + orderByModels.Add(orderByModel); + } + return _db.Queryable<TEntity>().WhereIF(whereExpression != null, whereExpression).OrderBy(orderByModels).Select(expression).FirstAsync(); + } + + public TEntity QueryFirst(Expression<Func<TEntity, bool>> whereExpression, Dictionary<string, OrderByType> orderBy) + { + List<OrderByModel> orderByModels = new List<OrderByModel>(); + foreach (var item in orderBy) + { + OrderByModel orderByModel = new OrderByModel() + { + FieldName = item.Key, + OrderByType = item.Value + }; + orderByModels.Add(orderByModel); + } + return _db.Queryable<TEntity>().WhereIF(whereExpression != null, whereExpression).OrderBy(orderByModels).First(); + } + + public Task<TEntity> QueryFirstAsync(Expression<Func<TEntity, bool>> whereExpression, Dictionary<string, OrderByType> orderBy) + { + List<OrderByModel> orderByModels = new List<OrderByModel>(); + foreach (var item in orderBy) + { + OrderByModel orderByModel = new OrderByModel() + { + FieldName = item.Key, + OrderByType = item.Value + }; + orderByModels.Add(orderByModel); + } + return _db.Queryable<TEntity>().WhereIF(whereExpression != null, whereExpression).OrderBy(orderByModels).FirstAsync(); + } + + public Task<List<TEntity>> QueryDataAsync(Expression<Func<TEntity, bool>> whereExpression, string orderByFields) + { + return _db.Queryable<TEntity>().WhereIF(whereExpression != null, whereExpression).OrderByIF(!string.IsNullOrEmpty(orderByFields), orderByFields).ToListAsync(); + } + + public Task<List<TEntity>> QueryDataAsync(string where, Dictionary<string, OrderByType> orderBy) + { + List<OrderByModel> orderByModels = new List<OrderByModel>(); + foreach (var item in orderBy) + { + OrderByModel orderByModel = new OrderByModel() + { + FieldName = item.Key, + OrderByType = item.Value + }; + orderByModels.Add(orderByModel); + } + return _db.Queryable<TEntity>().WhereIF(!string.IsNullOrEmpty(where), where).OrderBy(orderByModels).ToListAsync(); + } + + public Task<List<TResult>> QueryDataAsync<TResult>(Expression<Func<TEntity, TResult>> expression) + { + return _db.Queryable<TEntity>().Select(expression).ToListAsync(); + } + + public Task<List<TResult>> QueryDataAsync<TResult>(Expression<Func<TEntity, TResult>> expression, Expression<Func<TEntity, bool>> whereExpression, string orderByFields) + { + return _db.Queryable<TEntity>().OrderByIF(!string.IsNullOrEmpty(orderByFields), orderByFields).WhereIF(whereExpression != null, whereExpression).Select(expression).ToListAsync(); + } + + public Task<List<TEntity>> QueryDataAsync(Expression<Func<TEntity, bool>> whereExpression, Expression<Func<TEntity, object>> orderByExpression, bool isAsc = true) + { + return _db.Queryable<TEntity>().OrderByIF(orderByExpression != null, orderByExpression, isAsc ? OrderByType.Asc : OrderByType.Desc).WhereIF(whereExpression != null, whereExpression).ToListAsync(); + } + + public Task<List<TEntity>> QueryDataAsync(string where, string orderByFields) + { + return _db.Queryable<TEntity>().OrderByIF(!string.IsNullOrEmpty(orderByFields), orderByFields).WhereIF(!string.IsNullOrEmpty(where), where).ToListAsync(); + } + + public Task<List<TEntity>> QueryDataBySqlAsync(string sql, SugarParameter[]? parameters = null) + { + return _db.Ado.SqlQueryAsync<TEntity>(sql, parameters); + } + + public Task<List<dynamic>> QueryDynamicDataBySqlAsync(string sql, SugarParameter[]? parameters = null) + { + return _db.Ado.SqlQueryAsync<dynamic>(sql, parameters); + } + + public Task<List<object>> QueryObjectDataBySqlAsync(string sql, SugarParameter[]? parameters = null) + { + return _db.Ado.SqlQueryAsync<object>(sql, parameters); + } + + public Task<int> ExecuteSqlCommandAsync(string sql, params SqlParameter[] sqlParameters) + { + return _db.Ado.ExecuteCommandAsync(sql, sqlParameters); + } + + public Task<DataTable> QueryTableAsync(string sql, SugarParameter[]? parameters = null) + { + return _db.Ado.GetDataTableAsync(sql, parameters); + } + + public Task<List<TEntity>> QueryDataAsync(Expression<Func<TEntity, bool>> whereExpression, int top, string orderByFields) + { + return _db.Queryable<TEntity>().OrderByIF(!string.IsNullOrEmpty(orderByFields), orderByFields).WhereIF(whereExpression != null, whereExpression).Take(top).ToListAsync(); + } + + public Task<List<TEntity>> QueryDataAsync(string where, int top, string orderByFields) + { + return _db.Queryable<TEntity>().OrderByIF(!string.IsNullOrEmpty(orderByFields), orderByFields).WhereIF(!string.IsNullOrEmpty(where), where).Take(top).ToListAsync(); + } + + public Task<List<TEntity>> QueryDataAsync(Expression<Func<TEntity, bool>> whereExpression, int pageIndex, int pageSize, string orderByFields) + { + return _db.Queryable<TEntity>().OrderByIF(!string.IsNullOrEmpty(orderByFields), orderByFields) + .WhereIF(whereExpression != null, whereExpression).ToPageListAsync(pageIndex, pageSize); + } + + public Task<List<TEntity>> QueryDataAsync(string where, int pageIndex, int pageSize, string orderByFields) + { + return _db.Queryable<TEntity>().OrderByIF(!string.IsNullOrEmpty(orderByFields), orderByFields) + .WhereIF(!string.IsNullOrEmpty(where), where).ToPageListAsync(pageIndex, pageSize); + } + + public Task<List<TResult>> QueryTabsAsync<T, T2, TResult>(Expression<Func<T, T2, object[]>> joinExpression, Expression<Func<T, T2, TResult>> selectExpression, Expression<Func<TResult, bool>> whereExpression) + { + return _db.Queryable(joinExpression) + .Select(selectExpression) + .WhereIF(whereExpression != null, whereExpression).ToListAsync(); + } + + /// <summary> + /// 鏉′欢鏌ヨ鏁版嵁骞舵帓搴� + /// </summary> + /// <param name="whereExpression"></param> + /// <param name="orderByFields"></param> + /// <returns></returns> + public virtual List<TEntity> QueryData(Expression<Func<TEntity, bool>> whereExpression, Dictionary<string, OrderByType> orderBy) + { + List<OrderByModel> orderByModels = new List<OrderByModel>(); + foreach (var item in orderBy) + { + OrderByModel orderByModel = new OrderByModel() + { + FieldName = item.Key, + OrderByType = item.Value + }; + orderByModels.Add(orderByModel); + } + return _db.Queryable<TEntity>().WhereIF(whereExpression != null, whereExpression).OrderBy(orderByModels).ToList(); + } + + public Task<bool> UpdateDataNavAsync(TEntity Entity) + { + return _db.UpdateNav(Entity).IncludesAllFirstLayer().ExecuteCommandAsync(); + } + + public bool UpdateDataNav(TEntity Entity) + { + return _db.UpdateNav(Entity).IncludesAllFirstLayer().ExecuteCommand(); + } + + //List<TResult> QueryMuch<T, T2, T3, TResult>( + // Expression<Func<T, T2, T3, object[]>> joinExpression, + // Expression<Func<T, T2, T3, TResult>> selectExpression, + // Expression<Func<T, T2, T3, bool>> whereLambda = null) where T : class, new(){throw new NotImplementedException();} + //Task<PageModel<TEntity>> QueryPage(PaginationModel pagination){throw new NotImplementedException();} + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/BaseRepository/UnitOfWorks/IUnitOfWorkManage.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/BaseRepository/UnitOfWorks/IUnitOfWorkManage.cs" new file mode 100644 index 0000000..2723c74 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/BaseRepository/UnitOfWorks/IUnitOfWorkManage.cs" @@ -0,0 +1,26 @@ +锘縰sing SqlSugar; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using System.Text; +using System.Threading.Tasks; + +namespace WIDESEA_Core.BaseRepository +{ + public interface IUnitOfWorkManage + { + SqlSugarClient GetDbClient(); + int TranCount { get; } + + UnitOfWork CreateUnitOfWork(); + + void BeginTran(); + void BeginTran(MethodInfo method); + void CommitTran(); + void CommitTran(MethodInfo method); + void RollbackTran(); + void RollbackTran(MethodInfo method); + Task UseTranAsync(Func<Task> action); + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/BaseRepository/UnitOfWorks/UnitOfWork.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/BaseRepository/UnitOfWorks/UnitOfWork.cs" new file mode 100644 index 0000000..d4ca76b --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/BaseRepository/UnitOfWorks/UnitOfWork.cs" @@ -0,0 +1,55 @@ +锘縰sing Microsoft.Extensions.Logging; +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WIDESEA_Core.BaseRepository +{ + public class UnitOfWork : IDisposable + { + public ILogger Logger { get; set; } + public ISqlSugarClient Db { get; internal set; } + + public ITenant Tenant { get; internal set; } + + public bool IsTran { get; internal set; } + + public bool IsCommit { get; internal set; } + + public bool IsClose { get; internal set; } + + public void Dispose() + { + if (IsTran && !IsCommit) + { + Logger.LogDebug("UnitOfWork RollbackTran"); + this.Tenant.RollbackTran(); + } + + if (this.Db.Ado.Transaction != null || this.IsClose) + return; + this.Db.Close(); + } + + public bool Commit() + { + if (this.IsTran && !this.IsCommit) + { + Logger.LogDebug("UnitOfWork CommitTran"); + this.Tenant.CommitTran(); + this.IsCommit = true; + } + + if (this.Db.Ado.Transaction == null && !this.IsClose) + { + this.Db.Close(); + this.IsClose = true; + } + + return this.IsCommit; + } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/BaseRepository/UnitOfWorks/UnitOfWorkManage.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/BaseRepository/UnitOfWorks/UnitOfWorkManage.cs" new file mode 100644 index 0000000..4b550f4 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/BaseRepository/UnitOfWorks/UnitOfWorkManage.cs" @@ -0,0 +1,215 @@ +锘縰sing Microsoft.Extensions.Logging; +using SqlSugar; +using System; +using System.Collections.Concurrent; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Core.Helper; + +namespace WIDESEA_Core.BaseRepository +{ + public class UnitOfWorkManage : IUnitOfWorkManage + { + private readonly ILogger<UnitOfWorkManage> _logger; + private readonly ISqlSugarClient _sqlSugarClient; + + private int _tranCount { get; set; } + public int TranCount => _tranCount; + public readonly ConcurrentStack<string> TranStack = new(); + + public UnitOfWorkManage(ISqlSugarClient sqlSugarClient, ILogger<UnitOfWorkManage> logger) + { + _sqlSugarClient = sqlSugarClient; + _logger = logger; + _tranCount = 0; + } + + /// <summary> + /// 鑾峰彇DB锛屼繚璇佸敮涓�鎬� + /// </summary> + /// <returns></returns> + public SqlSugarClient GetDbClient() + { + // 蹇呴』瑕乤s锛屽悗杈逛細鐢ㄥ埌鍒囨崲鏁版嵁搴撴搷浣� + return _sqlSugarClient as SqlSugarClient; + } + + + public UnitOfWork CreateUnitOfWork() + { + UnitOfWork uow = new UnitOfWork(); + uow.Logger = _logger; + uow.Db = _sqlSugarClient; + uow.Tenant = (ITenant)_sqlSugarClient; + uow.IsTran = true; + + uow.Db.Open(); + uow.Tenant.BeginTran(); + + _logger.LogDebug("UnitOfWork Begin"); + return uow; + } + + public void BeginTran() + { + lock (this) + { + _tranCount++; + GetDbClient().BeginTran(); + } + } + + public void BeginTran(MethodInfo method) + { + lock (this) + { + GetDbClient().BeginTran(); + TranStack.Push(method.GetFullName()); + _tranCount = TranStack.Count; + } + } + + public WebResponseContent BeginTran(Func<WebResponseContent> func) + { + lock (this) + { + BeginTran(); + try + { + WebResponseContent content = func(); + if (content.Status) + { + CommitTran(); + } + else + { + RollbackTran(); + } + return content; + } + catch(Exception ex) + { + RollbackTran(); + return WebResponseContent.Instance.Error(ex.Message); + } + } + } + + public void CommitTran() + { + lock (this) + { + _tranCount--; + if (_tranCount == 0) + { + try + { + GetDbClient().CommitTran(); + } + catch (Exception ex) + { + Console.WriteLine(ex.Message); + GetDbClient().RollbackTran(); + } + } + } + } + + public void CommitTran(MethodInfo method) + { + lock (this) + { + string result = ""; + while (!TranStack.IsEmpty && !TranStack.TryPeek(out result)) + { + Thread.Sleep(1); + } + + + if (result == method.GetFullName()) + { + try + { + GetDbClient().CommitTran(); + + _logger.LogDebug($"Commit Transaction"); + Console.WriteLine($"Commit Transaction"); + } + catch (Exception ex) + { + Console.WriteLine(ex.Message); + GetDbClient().RollbackTran(); + _logger.LogDebug($"Commit Error , Rollback Transaction"); + } + finally + { + while (!TranStack.TryPop(out _)) + { + Thread.Sleep(1); + } + + _tranCount = TranStack.Count; + } + } + } + } + + public void RollbackTran() + { + lock (this) + { + _tranCount--; + GetDbClient().RollbackTran(); + } + } + + public void RollbackTran(MethodInfo method) + { + lock (this) + { + string result = ""; + while (!TranStack.IsEmpty && !TranStack.TryPeek(out result)) + { + Thread.Sleep(1); + } + + if (result == method.GetFullName()) + { + GetDbClient().RollbackTran(); + _logger.LogDebug($"Rollback Transaction"); + Console.WriteLine($"Rollback Transaction"); + while (!TranStack.TryPop(out _)) + { + Thread.Sleep(1); + } + + _tranCount = TranStack.Count; + } + } + } + + public async Task UseTranAsync(Func<Task> action) + { + // 寮�濮嬩簨鍔� + _sqlSugarClient.Ado.BeginTran(); + + try + { + // 鎵ц浼犲叆鐨勬搷浣� + await action(); + + // 鎻愪氦浜嬪姟 + await _sqlSugarClient.Ado.CommitTranAsync(); + } + catch (Exception ex) + { + // 鍥炴粴浜嬪姟 + await _sqlSugarClient.Ado.RollbackTranAsync(); + throw new Exception (ex.Message); // 閲嶆柊鎶涘嚭寮傚父锛屼互渚胯皟鐢ㄦ柟鍙互澶勭悊 + } + } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/BaseServices/IService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/BaseServices/IService.cs" new file mode 100644 index 0000000..7544e67 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/BaseServices/IService.cs" @@ -0,0 +1,121 @@ +锘縰sing Microsoft.AspNetCore.Http; +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WIDESEA_Core.BaseServices +{ + public interface IService<TEntity> : IDependency where TEntity : class + { + ISqlSugarClient Db { get; } + + /// <summary> + /// 鍒嗛〉鏌ヨ鏁版嵁 + /// </summary> + /// <param name="options"></param> + /// <returns></returns> + PageGridData<TEntity> GetPageData(PageDataOptions options); + + object GetDetailPage(PageDataOptions pageData); + + /// <summary> + /// 娣诲姞鏁版嵁 + /// </summary> + /// <param name="entity">鍗曚釜瀹炰綋</param> + /// <returns></returns> + WebResponseContent AddData(TEntity entity); + + /// <summary> + /// 娣诲姞鏁版嵁 + /// </summary> + /// <param name="entities">瀹炰綋闆嗗悎</param> + /// <returns></returns> + WebResponseContent AddData(List<TEntity> entities); + + /// <summary> + /// 娣诲姞鏁版嵁 + /// </summary> + /// <param name="saveModel"></param> + /// <returns></returns> + WebResponseContent AddData(SaveModel saveModel); + + /// <summary> + /// 淇敼鏁版嵁 + /// </summary> + /// <param name="entity">鍗曚釜瀹炰綋</param> + /// <returns></returns> + WebResponseContent UpdateData(TEntity entity); + + /// <summary> + /// 淇敼鏁版嵁 + /// </summary> + /// <param name="entities">瀹炰綋闆嗗悎</param> + /// <returns></returns> + WebResponseContent UpdateData(List<TEntity> entities); + + /// <summary> + /// 淇敼鏁版嵁 + /// </summary> + /// <param name="saveModel"></param> + /// <returns></returns> + WebResponseContent UpdateData(SaveModel saveModel); + + /// <summary> + /// 鍒犻櫎鏁版嵁 + /// </summary> + /// <param name="key">涓婚敭</param> + /// <returns></returns> + WebResponseContent DeleteData(object key); + + /// <summary> + /// 鍒犻櫎鏁版嵁 + /// </summary> + /// <param name="keys">涓婚敭鏁扮粍</param> + /// <returns></returns> + WebResponseContent DeleteData(object[] keys); + + /// <summary> + /// 鍒犻櫎鏁版嵁 + /// </summary> + /// <param name="entity">鍗曚釜瀹炰綋</param> + /// <returns></returns> + WebResponseContent DeleteData(TEntity entity); + + /// <summary> + /// 鍒犻櫎鏁版嵁 + /// </summary> + /// <param name="entities">瀹炰綋闆嗗悎</param> + /// <returns></returns> + WebResponseContent DeleteData(List<TEntity> entities); + + /// <summary> + /// 瀵煎嚭鏁版嵁 + /// </summary> + /// <param name="pageData"></param> + /// <returns></returns> + WebResponseContent Export(PageDataOptions pageData); + + /// <summary> + /// 瀵煎叆鏁版嵁 + /// </summary> + /// <param name="files"></param> + /// <returns></returns> + WebResponseContent Import(List<IFormFile> files); + + /// <summary> + /// 涓婁紶鏂囦欢 + /// </summary> + /// <param name="files"></param> + /// <returns></returns> + WebResponseContent Upload(List<IFormFile> files); + + /// <summary> + /// 妯℃澘涓嬭浇 + /// </summary> + /// <returns></returns> + WebResponseContent DownLoadTemplate(); + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/BaseServices/ServiceBase.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/BaseServices/ServiceBase.cs" new file mode 100644 index 0000000..e2fe74b --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/BaseServices/ServiceBase.cs" @@ -0,0 +1,752 @@ +锘縰sing Magicodes.ExporterAndImporter.Core; +using Magicodes.ExporterAndImporter.Core.Models; +using Magicodes.ExporterAndImporter.Excel; +using Microsoft.AspNetCore.Http; +using Microsoft.Extensions.Options; +using OfficeOpenXml.FormulaParsing.Excel.Functions.Text; +using SqlSugar; +using System.Drawing.Drawing2D; +using System.Dynamic; +using System.Linq.Expressions; +using System.Reflection; +using WIDESEA_Core.BaseRepository; +using WIDESEA_Core.Enums; +using WIDESEA_Core.Helper; +using WIDESEA_Core.Utilities; + +namespace WIDESEA_Core.BaseServices +{ + public class ServiceBase<TEntity, TRepository> : ServiceFunFilter<TEntity>, IService<TEntity> + where TEntity : class, new() + where TRepository : IRepository<TEntity> + + { + public ServiceBase(TRepository BaseDal) + { + this.BaseDal = BaseDal; + } + + public TRepository BaseDal { get; set; } //閫氳繃鍦ㄥ瓙绫荤殑鏋勯�犲嚱鏁颁腑娉ㄥ叆锛岃繖閲屾槸鍩虹被锛屼笉鐢ㄦ瀯閫犲嚱鏁� + + public ISqlSugarClient Db => BaseDal.Db; + + private PropertyInfo[] _propertyInfo { get; set; } = null; + public PropertyInfo[] TProperties + { + get + { + if (_propertyInfo != null) + { + return _propertyInfo; + } + _propertyInfo = typeof(TEntity).GetProperties(); + return _propertyInfo; + } + } + + public virtual PageGridData<TEntity> GetPageData(PageDataOptions options) + { + string wheres = ValidatePageOptions(options); + //鑾峰彇鎺掑簭瀛楁 + Dictionary<string, OrderByType> orderbyDic = GetPageDataSort(options, TProperties); + + PageGridData<TEntity> pageGridData = new PageGridData<TEntity>(); + //if (QueryRelativeExpression != null) + //{ + // queryable = QueryRelativeExpression.Invoke(queryable); + //} + //if (options.Export) + //{ + // queryable = queryable.GetIQueryableOrderBy(orderbyDic); + // if (Limit > 0) + // { + // queryable = queryable.Take(Limit); + // } + // pageGridData.rows = queryable.ToList(); + //} + //else + //{ + // pageGridData.rows = repository.IQueryablePage(queryable, + // options.Page, + // options.Rows, + // out int rowCount, + // orderbyDic).ToList(); + // pageGridData.total = rowCount; + // //鏌ヨ鐣岄潰缁熻姹傜瓑瀛楁 + // if (SummaryExpress != null) + // { + // pageGridData.summary = SummaryExpress.Invoke(queryable); + // //Func<T, T> groupExpress = x =>x; + // //pageGridData.summary = queryable.GroupBy(groupExpress).Select(SummaryExpress).FirstOrDefault(); + // } + //} + //GetPageDataOnExecuted?.Invoke(pageGridData); + + pageGridData = BaseDal.QueryPage + (wheres, options.Page, options.Rows, orderbyDic); + + return pageGridData; + } + + + protected string ValidatePageOptions(PageDataOptions options) + { + options = options ?? new PageDataOptions(); + string where = ""; + List<SearchParameters> searchParametersList = new List<SearchParameters>(); + if (options.Filter != null && options.Filter.Count > 0) + { + searchParametersList.AddRange(options.Filter); + } + else if (!string.IsNullOrEmpty(options.Wheres)) + { + try + { + searchParametersList = options.Wheres.DeserializeObject<List<SearchParameters>>(); + options.Filter = searchParametersList; + } + catch { } + } + QueryRelativeList?.Invoke(searchParametersList); + + for (int i = 0; i < searchParametersList.Count; i++) + { + if (string.IsNullOrEmpty(searchParametersList[i].Value)) + { + continue; + } + + PropertyInfo property = TProperties.Where(c => c.Name.ToUpper() == searchParametersList[i].Name.ToUpper()).FirstOrDefault(); + + if (property == null) continue; + + (bool, string, object) result = property.ValidationVal(searchParametersList[i].Value); + if (!result.Item1) + { + continue; + } + + LinqExpressionType expressionType = searchParametersList[i].DisplayType.GetLinqCondition(); + if (expressionType == LinqExpressionType.Equal) + { + if (string.IsNullOrEmpty(where)) + { + // 閽堝瀛楃涓茬被鍨嬬殑瀛楁浣跨敤妯$硦鏌ヨ + //where += $"{searchParametersList[i].Name} like '%{searchParametersList[i].Value}%'"; + if (searchParametersList[i].Value.ToLower() == "true" || searchParametersList[i].Value.ToLower() == "false") + { + where += $" {searchParametersList[i].Name} = '{searchParametersList[i].Value.ToLower()}'"; + } + else + { + where += $"[{searchParametersList[i].Name}] like '%{searchParametersList[i].Value}%'"; + } + } + else + { + // 閽堝甯冨皵绫诲瀷瀛楁杩涜绮剧‘鏌ヨ + if (searchParametersList[i].Value.ToLower() == "true" || searchParametersList[i].Value.ToLower() == "false") + { + where += $" and {searchParametersList[i].Name} = '{searchParametersList[i].Value.ToLower()}'"; + } + else + { + where += $" and {searchParametersList[i].Name} like '%{searchParametersList[i].Value}%'"; + } + } + } + else + { + if (string.IsNullOrEmpty(where)) + where += $"{searchParametersList[i].Name} {searchParametersList[i].DisplayType} '{searchParametersList[i].Value}'"; + else + where += $" and {searchParametersList[i].Name} {searchParametersList[i].DisplayType} '{searchParametersList[i].Value}'"; + } + } + return where; + } + + /// <summary> + /// 鑾峰彇鎺掑簭瀛楁 + /// </summary> + /// <param name="pageData"></param> + /// <param name="propertyInfo"></param> + /// <returns></returns> + public Dictionary<string, OrderByType> GetPageDataSort(PageDataOptions pageData, PropertyInfo[] propertyInfo) + { + if (!string.IsNullOrEmpty(pageData.Sort)) + { + if (pageData.Sort.Contains(",")) + { + List<string> sortArr = pageData.Sort.Split(",").Where(x => propertyInfo.Any(p => p.Name == x)).ToList(); + Dictionary<string, OrderByType> sortDic = new Dictionary<string, OrderByType>(); + foreach (var item in sortArr) + { + sortDic[item] = pageData.Order?.ToLower() == OrderByType.Asc.ToString() ? OrderByType.Asc : OrderByType.Desc; + } + return sortDic; + } + else if (propertyInfo.Any(x => x.Name.ToUpper() == pageData.Sort.ToUpper())) + { + return new Dictionary<string, OrderByType> { + { + pageData.Sort,pageData.Order?.ToLower() == OrderByType.Asc.ToString().ToLower()? OrderByType.Asc : OrderByType.Desc + } }; + } + } + return new Dictionary<string, OrderByType> { { "CreateDate", pageData.Order?.ToLower() == OrderByType.Asc.ToString() ? OrderByType.Asc : OrderByType.Desc } }; + } + + public virtual object GetDetailPage(PageDataOptions pageData) + { + Type t = typeof(TEntity); + + if (pageData.Value == null) return new PageGridData<object>(total: 0, null); + string keyName = t.GetKeyName(); + ////鐢熸垚鏌ヨ鏉′欢 + //Expression<Func<TEntity, bool>> whereExpression = keyName.CreateExpression<TEntity>(pageData.Value, LinqExpressionType.Equal); + int totalCount = 0; + PropertyInfo propertyInfo = t.GetProperties().FirstOrDefault(x => x.GetCustomAttribute<Navigate>() != null); + if (propertyInfo != null) + { + Type detailType = propertyInfo.PropertyType.GetGenericArguments()[0]; + Navigate navigate = propertyInfo.GetCustomAttribute<Navigate>(); + List<ExpandoObject> list = BaseDal.Db.Queryable(detailType.Name, "detail").Where(navigate.GetName(), "=", pageData.Value).ToPageList(pageData.Page, pageData.Rows, ref totalCount); + return new PageGridData<ExpandoObject>(totalCount, list); + } + return new PageGridData<object>(total: 0, null); + } + + /// <summary> + /// 娣诲姞鏁版嵁 + /// </summary> + /// <param name="entity">鍗曚釜瀹炰綋</param> + /// <returns></returns> + public virtual WebResponseContent AddData(TEntity entity) + { + try + { + return BaseDal.AddData(entity) > 0 ? WebResponseContent.Instance.OK() : WebResponseContent.Instance.Error(); + } + catch (Exception ex) + { + return WebResponseContent.Instance.Error(ex.Message); + } + } + + /// <summary> + /// 娣诲姞鏁版嵁 + /// </summary> + /// <param name="entities">瀹炰綋闆嗗悎</param> + /// <returns></returns> + public virtual WebResponseContent AddData(List<TEntity> entities) + { + try + { + return BaseDal.AddData(entities) > 0 ? WebResponseContent.Instance.OK() : WebResponseContent.Instance.Error(); + } + catch (Exception ex) + { + return WebResponseContent.Instance.Error(ex.Message); + } + } + + /// <summary> + /// 娣诲姞鏁版嵁 + /// </summary> + /// <param name="saveModel"></param> + /// <returns></returns> + public virtual WebResponseContent AddData(SaveModel saveModel) + { + try + { + if (saveModel == null || saveModel.MainData == null || saveModel.MainData.Count == 0)//鍒ゆ柇鍙傛暟鏄惁浼犲叆 + { + return WebResponseContent.Instance.Error("浼犲弬閿欒,鍙傛暟涓嶈兘涓虹┖"); + } + string validResult = typeof(TEntity).ValidateDicInEntity(saveModel.MainData, true, TProperties); + + if (!string.IsNullOrEmpty(validResult)) + { + return WebResponseContent.Instance.Error(validResult); + } + + PropertyInfo keyPro = typeof(TEntity).GetKeyProperty(); + if (keyPro == null) + { + return WebResponseContent.Instance.Error("璇峰厛璁剧疆涓婚敭"); + } + if (keyPro.PropertyType == typeof(Guid)) + { + saveModel.MainData.Add(keyPro.Name, Guid.NewGuid()); + } + else if (keyPro.PropertyType == typeof(int) || keyPro.PropertyType == typeof(long)) + { + SugarColumn sugarColumn = keyPro.GetCustomAttribute<SugarColumn>(); + if (sugarColumn.IsIdentity) + { + saveModel.MainData.Remove(keyPro.Name.FirstLetterToUpper()); + saveModel.MainData.Remove(keyPro.Name.FirstLetterToLower()); + } + } + TEntity entity = saveModel.MainData.DicToModel<TEntity>(); + //if (saveModel.DetailData == null && saveModel.DetailData.Count == 0) + if (saveModel.DetailData == null ) + { + BaseDal.AddData(entity); + return WebResponseContent.Instance.OK(); + } + + if (typeof(TEntity).GetNavigatePro() == null) + { + return WebResponseContent.Instance.Error("鏈厤缃鑸睘鎬�"); + } + + Type detailType = typeof(TEntity).GetDetailType(); + MethodInfo? methodInfo = GetType().GetMethod("AddDataIncludesDetail"); + methodInfo = methodInfo?.MakeGenericMethod(new Type[] { detailType }); + object? obj = methodInfo?.Invoke(this, new object[] { entity, detailType, saveModel.DetailData }); + return obj as WebResponseContent; + } + catch (Exception ex) + { + return WebResponseContent.Instance.Error(ex.Message); + } + } + + public WebResponseContent AddDataIncludesDetail<TDetail>(TEntity entity, Type detailType, List<Dictionary<string, object>> detailDics) where TDetail : class, new() + { + WebResponseContent content = new WebResponseContent(); + try + { + string name = typeof(TEntity).GetMainIdByDetail(); + string reslut = detailType.ValidateDicInEntity(detailDics, true, new string[] { name }); + if (reslut != string.Empty) + return WebResponseContent.Instance.Error(reslut); + + List<TDetail> list = detailDics.DicToIEnumerable<TDetail>(); + + ((SqlSugarClient)BaseDal.Db).BeginTran(); + + int id = BaseDal.Db.Insertable(entity).ExecuteReturnIdentity(); + + for (int i = 0; i < list.Count; i++) + { + TDetail detail = list[i]; + typeof(TDetail).SetDetailId(detail, id, name); + } + + BaseDal.Db.Insertable(list).ExecuteCommand(); + + ((SqlSugarClient)BaseDal.Db).CommitTran(); + + content = WebResponseContent.Instance.OK(); + } + catch (Exception ex) + { + ((SqlSugarClient)BaseDal.Db).RollbackTran(); + content = WebResponseContent.Instance.Error(ex.Message); + } + return content; + } + + + /// <summary> + /// 淇敼鏁版嵁 + /// </summary> + /// <param name="entity">鍗曚釜瀹炰綋</param> + /// <returns></returns> + public virtual WebResponseContent UpdateData(TEntity entity) + { + try + { + return BaseDal.UpdateData(entity) ? WebResponseContent.Instance.OK() : WebResponseContent.Instance.Error(); + } + catch (Exception ex) + { + return WebResponseContent.Instance.Error(ex.Message); + } + } + + /// <summary> + /// 淇敼鏁版嵁 + /// </summary> + /// <param name="entities">瀹炰綋闆嗗悎</param> + /// <returns></returns> + public virtual WebResponseContent UpdateData(List<TEntity> entities) + { + try + { + return BaseDal.UpdateData(entities) ? WebResponseContent.Instance.OK() : WebResponseContent.Instance.Error(); + } + catch (Exception ex) + { + return WebResponseContent.Instance.Error(ex.Message); + } + } + + /// <summary> + /// 淇敼鏁版嵁 + /// </summary> + /// <param name="saveModel"></param> + /// <returns></returns> + public virtual WebResponseContent UpdateData(SaveModel saveModel) + { + try + { + List<string>? list = UpdateIgnoreColOnExecute?.Invoke(saveModel); + if (saveModel == null || saveModel.MainData == null || saveModel.MainData.Count == 0)//鍒ゆ柇鍙傛暟鏄惁浼犲叆 + { + return WebResponseContent.Instance.Error("浼犲弬閿欒,鍙傛暟涓嶈兘涓虹┖"); + } + string validResult = typeof(TEntity).ValidateDicInEntity(saveModel.MainData, false, TProperties, list?.ToArray()); + + if (!string.IsNullOrEmpty(validResult)) + { + return WebResponseContent.Instance.Error(validResult); + } + + PropertyInfo keyPro = typeof(TEntity).GetKeyProperty(); + if (keyPro == null) + { + return WebResponseContent.Instance.Error("璇峰厛璁剧疆涓婚敭"); + } + + TEntity entity = saveModel.MainData.DicToModel<TEntity>(); + + List<string> listCol = new List<string>(); + foreach (var item in saveModel.MainData) + { + PropertyInfo propertyInfo = typeof(TEntity).GetProperty(item.Key); + if (propertyInfo == null) + { + propertyInfo = typeof(TEntity).GetProperty(item.Key.FirstLetterToLower()); + if (propertyInfo == null) + { + propertyInfo = typeof(TEntity).GetProperty(item.Key.FirstLetterToUpper()); + } + } + + listCol.Add(propertyInfo?.Name); + } + + //if (saveModel.DetailData == null && saveModel.DetailData.Count == 0) + if (saveModel.DetailData == null) + { + if (list != null) + listCol = listCol.Where(x => !list.Contains(x)).ToList(); + bool result = BaseDal.UpdateData(entity, listCol, list); + return WebResponseContent.Instance.OK(); + } + + if (typeof(TEntity).GetNavigatePro() == null) + { + return WebResponseContent.Instance.Error("鏈厤缃鑸睘鎬�"); + } + + Type detailType = typeof(TEntity).GetDetailType(); + MethodInfo? methodInfo = GetType().GetMethod("UpdateDataInculdesDetail"); + methodInfo = methodInfo?.MakeGenericMethod(new Type[] { detailType }); + object? obj = methodInfo?.Invoke(this, new object[] { entity, detailType, saveModel.DetailData, saveModel.DelKeys }); + return obj as WebResponseContent; + } + catch (Exception ex) + { + return WebResponseContent.Instance.Error(ex.Message); + } + } + + public WebResponseContent UpdateDataInculdesDetail<TDetail>(TEntity entity, Type detailType, List<Dictionary<string, object>> detailDics, List<object> delKeys) where TDetail : class, new() + { + WebResponseContent content = new WebResponseContent(); + try + { + string name = typeof(TEntity).GetMainIdByDetail(); + string reslut = detailType.ValidateDicInEntity(detailDics, true, new string[] { name }); + if (reslut != string.Empty) + return WebResponseContent.Instance.Error(reslut); + + List<TDetail> list = detailDics.DicToIEnumerable<TDetail>(); + + List<object> dynamicDelKeys = new List<object>(); + if (delKeys != null) + { + for (int i = 0; i < delKeys.Count; i++) + { + dynamicDelKeys.Add(delKeys[i]); + } + } + + List<TDetail> updateRows = new List<TDetail>(); + List<TDetail> addRows = new List<TDetail>(); + + for (int i = 0; i < list.Count; i++) + { + object detailId = typeof(TDetail).GetPropertyValue(list[i], typeof(TDetail).GetKeyName()); + if (detailId != null) + { + if (detailId.ToString() != "0") + { + updateRows.Add(list[i]); + } + else + { + addRows.Add(list[i]); + } + } + } + + object mainId = typeof(TEntity).GetPropertyValue(entity, typeof(TEntity).GetKeyName()); + if (mainId != null) + { + ((SqlSugarClient)BaseDal.Db).BeginTran(); + + if (dynamicDelKeys.Count > 0) + BaseDal.Db.Deleteable<object>().AS(detailType.Name).Where($"{detailType.GetKeyName()} in (@id)", new { id = dynamicDelKeys.ToArray() }).ExecuteCommandHasChange(); + + BaseDal.Db.Updateable(entity).ExecuteCommandHasChange(); + + BaseDal.Db.Updateable(updateRows).ExecuteCommand(); + + for (int i = 0; i < addRows.Count; i++) + { + TDetail detail = addRows[i]; + typeof(TDetail).SetDetailId(detail, mainId, name); + } + + BaseDal.Db.Insertable(addRows).ExecuteCommand(); + + ((SqlSugarClient)BaseDal.Db).CommitTran(); + + content = WebResponseContent.Instance.OK(); + } + else + { + content = WebResponseContent.Instance.Error("鏈壘鍒颁富琛ㄤ富閿��"); + } + + } + catch (Exception ex) + { + ((SqlSugarClient)BaseDal.Db).RollbackTran(); + content = WebResponseContent.Instance.Error(ex.Message); + } + return content; + } + + + /// <summary> + /// 鍒犻櫎鏁版嵁 + /// </summary> + /// <param name="key">涓婚敭</param> + /// <returns></returns> + public virtual WebResponseContent DeleteData(object key) + { + try + { + return BaseDal.DeleteDataById(key) ? WebResponseContent.Instance.OK() : WebResponseContent.Instance.Error(); + } + catch (Exception ex) + { + return WebResponseContent.Instance.Error(ex.Message); + } + } + + /// <summary> + /// 鍒犻櫎鏁版嵁 + /// </summary> + /// <param name="keys">涓婚敭鏁扮粍</param> + /// <returns></returns> + public virtual WebResponseContent DeleteData(object[] keys) + { + try + { + if (typeof(TEntity).GetNavigatePro() == null) + return BaseDal.DeleteDataByIds(keys) ? WebResponseContent.Instance.OK("鍒犻櫎鎴愬姛") : WebResponseContent.Instance.Error(); + else + { + if (keys != null) + { + Type detailType = typeof(TEntity).GetDetailType(); + string name = typeof(TEntity).GetMainIdByDetail(); + List<object> dynamicDelKeys = new List<object>(); + + for (int i = 0; i < keys.Length; i++) + { + dynamicDelKeys.Add(keys[i]); + } + ((SqlSugarClient)BaseDal.Db).BeginTran(); + + if (dynamicDelKeys.Count > 0) + BaseDal.Db.Deleteable<object>().AS(detailType.Name).Where($"{name} in (@id)", new { id = dynamicDelKeys.ToArray() }).ExecuteCommandHasChange(); + + BaseDal.DeleteDataByIds(keys); + + ((SqlSugarClient)BaseDal.Db).CommitTran(); + + return WebResponseContent.Instance.OK("鍒犻櫎鎴愬姛"); + } + else + { + return WebResponseContent.Instance.Error("鍙傛暟閿欒"); + } + } + } + catch (Exception ex) + { + ((SqlSugarClient)BaseDal.Db).RollbackTran(); + return WebResponseContent.Instance.Error(ex.Message); + } + } + + /// <summary> + /// 鍒犻櫎鏁版嵁 + /// </summary> + /// <param name="entity">鍗曚釜瀹炰綋</param> + /// <returns></returns> + public virtual WebResponseContent DeleteData(TEntity entity) + { + try + { + return BaseDal.DeleteData(entity) ? WebResponseContent.Instance.OK() : WebResponseContent.Instance.Error(); + } + catch (Exception ex) + { + return WebResponseContent.Instance.Error(ex.Message); + } + } + + /// <summary> + /// 鍒犻櫎鏁版嵁 + /// </summary> + /// <param name="entities">瀹炰綋闆嗗悎</param> + /// <returns></returns> + public virtual WebResponseContent DeleteData(List<TEntity> entities) + { + try + { + return BaseDal.DeleteData(entities) ? WebResponseContent.Instance.OK() : WebResponseContent.Instance.Error(); + } + catch (Exception ex) + { + return WebResponseContent.Instance.Error(ex.Message); + } + } + + /// <summary> + /// 瀵煎嚭鏁版嵁 + /// </summary> + /// <param name="pageData"></param> + /// <returns></returns> + public virtual WebResponseContent Export(PageDataOptions options) + { + WebResponseContent content = new WebResponseContent(); + try + { + Type t = typeof(TEntity); + + string savePath = AppDomain.CurrentDomain.BaseDirectory + $"ExcelExport"; + IExporter exporter = new ExcelExporter(); + string wheres = ValidatePageOptions(options); + //鑾峰彇鎺掑簭瀛楁 + Dictionary<string, OrderByType> orderbyDic = GetPageDataSort(options, TProperties); + + List<TEntity> entities = BaseDal.QueryData(wheres, orderbyDic); + + byte[] data = exporter.ExportAsByteArray(entities).Result; + + string fileName = ""; + SugarTable sugarTable = t.GetCustomAttribute<SugarTable>(); + if (sugarTable != null) + { + fileName = sugarTable.TableDescription + ".xlsx"; + } + else + { + fileName = nameof(TEntity) + ".xlsx"; + } + + FileHelper.WriteFile(savePath, fileName, data); + + content = WebResponseContent.Instance.OK(data: savePath + "\\" + fileName); + } + catch (Exception ex) + { + content = WebResponseContent.Instance.Error(ex.Message); + } + return content; + } + + /// <summary> + /// 瀵煎叆鏁版嵁 + /// </summary> + /// <param name="files"></param> + /// <returns></returns> + public virtual WebResponseContent Import(List<IFormFile> files) + { + try + { + if (files == null || files.Count == 0) + return new WebResponseContent { Status = true, Message = "璇烽�夋嫨涓婁紶鐨勬枃浠�" }; + Microsoft.AspNetCore.Http.IFormFile formFile = files[0]; + string dicPath = AppDomain.CurrentDomain.BaseDirectory + $"ExcelImprot/{DateTime.Now.ToString("yyyMMdd")}/{typeof(TEntity).Name}/"; + if (!Directory.Exists(dicPath)) Directory.CreateDirectory(dicPath); + string fileName = $"{Guid.NewGuid()}_{formFile.FileName}"; + dicPath = $"{dicPath}{fileName}"; + using (FileStream stream = new FileStream(dicPath, FileMode.Create)) + { + formFile.CopyTo(stream); + } + ExcelImporter importer = new ExcelImporter(); + ImportResult<TEntity> importResult = importer.Import<TEntity>(dicPath, "").Result; + if (importResult.HasError) + { + return WebResponseContent.Instance.Error(importResult.TemplateErrors.Serialize()); + } + BaseDal.AddData(importResult.Data.ToList()); + return WebResponseContent.Instance.OK(); + } + catch (Exception ex) + { + return WebResponseContent.Instance.Error(ex.Message); + } + } + + /// <summary> + /// 涓婁紶鏂囦欢 + /// </summary> + /// <param name="files"></param> + /// <returns></returns> + public virtual WebResponseContent Upload(List<IFormFile> files) + { + throw new NotImplementedException(); + } + + /// <summary> + /// 妯℃澘涓嬭浇 + /// </summary> + /// <returns></returns> + public virtual WebResponseContent DownLoadTemplate() + { + WebResponseContent content = new WebResponseContent(); + Type t = typeof(TEntity); + IExporter exporter = new ExcelExporter(); + byte[] data = exporter.ExportHeaderAsByteArray(new TEntity()).Result; + string fileName = ""; + SugarTable sugarTable = t.GetCustomAttribute<SugarTable>(); + if (sugarTable != null) + { + fileName = sugarTable.TableDescription + "瀵煎叆妯℃澘.xlsx"; + } + else + { + fileName = nameof(TEntity) + "瀵煎叆妯℃澘.xlsx"; + } + string savePath = AppDomain.CurrentDomain.BaseDirectory + $"ExcelImprotTemplate"; + FileHelper.WriteFile(savePath, fileName, data); + + content = WebResponseContent.Instance.OK(data: savePath + "\\" + fileName); + return content; + } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/BaseServices/ServiceFunFilter.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/BaseServices/ServiceFunFilter.cs" new file mode 100644 index 0000000..441cd3d --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/BaseServices/ServiceFunFilter.cs" @@ -0,0 +1,234 @@ +锘縰sing SqlSugar; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Linq.Expressions; +using System.Text; +using System.Threading.Tasks; + +namespace WIDESEA_Core.BaseServices +{ + public abstract class ServiceFunFilter<T> where T : class + { + /// <summary> + /// 2020.08.15鏄惁寮�鍚绉熸埛鍔熻兘 + /// 浣跨敤鏂规硶瑙佹枃妗f垨SellOrderService.cs + /// </summary> + protected bool IsMultiTenancy { get; set; } + + /// <summary> + /// 鏌ヨ鐣岄潰table 缁熻銆佹眰鍜屻�佸钩鍧囧�肩瓑 + /// 瀹炵幇鏂瑰紡 + ///SummaryExpress = (IQueryable<App_TransactionAvgPrice> queryable) => + // { + // return queryable.GroupBy(x => 1).Select(x => new + // { + // AvgPrice = x.Average(o => o.AvgPrice), + // Enable = x.Sum(o => o.Enable) + // }).FirstOrDefault(); + //}; + /// </summary> + // protected Func<IGrouping<T, T>, object> SummaryExpress = null; + protected Func<IQueryable<T>, object> SummaryExpress = null; + + /// <summary> + /// 鏄庣粏table 缁熻銆佹眰鍜屻�佸钩鍧囧�肩瓑 + /// </summary> + /// <typeparam name="Detail"></typeparam> + /// <param name="queryeable"></param> + /// <returns></returns> + //protected abstract object GetDetailSummary<Detail>(IQueryable<Detail> queryeable); + + /// <summary> + /// 鏄惁寮�鍚敤鎴锋暟鎹潈闄�,true=鐢ㄦ埛鍙兘鎿嶄綔鑷繁(鍙婁笅绾ц鑹�)鍒涘缓鐨勬暟鎹�,濡�:鏌ヨ銆佸垹闄ゃ�佷慨鏀圭瓑鎿嶄綔 + /// 娉ㄦ剰锛氶渶瑕佸湪浠g爜鐢熸垚鍣ㄧ晫闈㈤�夋嫨銆愭槸銆戝強鐢熸垚Model鎵嶄細鐢熸晥) + /// </summary> + protected bool LimitCurrentUserPermission { get; set; } = false; + + ///榛樿瀵煎嚭鏈�澶ц〃鏁伴噺锛�0涓嶉檺鍒� + protected int Limit { get; set; } = 0; + + /// <summary> + /// 榛樿涓婁紶鏂囦欢澶у皬闄愬埗3M + /// </summary> + protected int LimitUpFileSizee { get; set; } = 3; + + + /// <summary> + /// 2020.08.15娣诲姞鑷畾涔夊師鐢熸煡璇ql,杩欎釜瀵逛簬涓嶆兂鍐欒〃杈惧紡鍏宠仈鎴栬�呭鏉傛煡璇㈤潪甯告湁鐢� + /// 渚嬶細QuerySql=$"select * from tb1 as a where a.name='xxxx' x.id in (select b.id from tb2 b)"; + /// select * 杩欓噷鍙互鑷畾涔夛紝浣唖elect 蹇呴』杩斿洖琛ㄦ墍鏈夌殑鍒楋紝涓嶈兘灏� + /// </summary> + protected string QuerySql = null; + + /// <summary> + /// 鏌ヨ鍓�,瀵圭幇鍦ㄦ湁鐨勬煡璇㈠瓧绗︿覆鏉′欢澧炲姞鎴栧垹闄� + /// </summary> + protected Action<List<SearchParameters>> QueryRelativeList { get; set; } + + //鏌ヨ鍓�,鍦ㄧ幇鏈夌殑鏌ヨ鏉′欢涓婇�氳繃琛ㄨ揪寮忎慨鏀规煡璇㈡潯浠� + protected Func<IQueryable<T>, IQueryable<T>> QueryRelativeExpression { get; set; } + + + /// <summary> + /// 鎸囧畾鏌ヨ鐨勫垪锛屾牸寮�:Expression<Func<T, object>> exp = x => new { x.瀛楁1, x.瀛楁2 }(鏆傛椂鏈惎鐢�) + /// </summary> + protected Expression<Func<T, object>> Columns { get; set; } + + /// <summary> + /// 璁剧疆鏌ヨ鎺掑簭鍙傛暟鍙婃柟寮�,鍙傛暟鏍煎紡涓猴細 + /// Expression<Func<T, Dictionary<object, bool>>> orderBy = x => new Dictionary<object, QueryOrderBy>() + /// {{ x.ID, QueryOrderBy.Asc },{ x.DestWarehouseName, QueryOrderBy.Desc } }; + /// 杩斿洖鐨勬槸new Dictionary<object, bool>(){{}}key涓烘帓搴忓瓧娈碉紝QueryOrderBy涓烘帓搴忔柟寮� + /// </summary> + protected Expression<Func<T, Dictionary<object, OrderByType>>> OrderByExpression; + + /// <summary> + /// 璁剧疆鏌ヨ鐨勮〃鍚�(宸插純鐢�) + /// </summary> + protected string TableName { get; set; } + + /// <summary> + /// 椤甸潰鏌ヨ鎴栧鍑猴紝浠庢暟鎹簱鏌ヨ鍑烘潵鐨勭粨鏋� + /// </summary> + protected Action<PageGridData<T>> GetPageDataOnExecuted; + + /// <summary> + /// 璋冪敤鏂板缓澶勭悊鍓�(SaveModel涓轰紶鍏ョ殑鍘熺敓鏁版嵁) + /// </summary> + protected Func<SaveModel, WebResponseContent> AddOnExecute; + + /// <summary> + /// 璋冪敤鏂板缓淇濆瓨鏁版嵁搴撳墠澶勭悊(宸插皢鎻愪氦鐨勫師鐢熸暟鎹浆鎹㈡垚浜嗗璞�) + /// Func<T, object,ResponseData> T涓轰富琛ㄦ暟鎹紝object涓烘槑缁嗘暟鎹�(濡傛灉闇�瑕佷娇鐢ㄦ槑缁嗗璞�,璇风敤 object as List<T>杞崲) + /// </summary> + protected Func<T, object, WebResponseContent> AddOnExecuting; + + /// <summary> + /// 璋冪敤鏂板缓淇濆瓨鏁版嵁搴撳悗澶勭悊銆� + /// **瀹炵幇褰撳墠鏂规硶鏃讹紝鍐呴儴榛樿宸茬粡寮�鍚簨鍔★紝濡傛灉瀹炵幇鐨勬柟娉曟搷浣滅殑鏄悓涓�鏁版嵁搴�,鍒欎笉闇�瑕佸湪AddOnExecuted涓簨鍔� + /// Func<T, object,ResponseData> T涓轰富琛ㄦ暟鎹紝object涓烘槑缁嗘暟鎹�(濡傛灉闇�瑕佷娇鐢ㄦ槑缁嗗璞�,璇风敤 object as List<T>杞崲) + /// 姝ゅ宸插紑鍚簡DbContext浜嬪姟(閲嶇偣),濡傛灉杩樻湁鍏朵粬涓氬姟澶勪簨锛岀洿鎺ュ湪杩欓噷鍐橢F浠g爜,涓嶉渶瑕佸啀寮�鍚簨鍔� + /// 濡傛灉鎵ц鐨勬槸鎵嬪啓sql璇风敤repository.DbContext.Database.ExecuteSqlCommand()鎴� repository.DbContext.Set<T>().FromSql鎵ц鍏蜂綋sql璇彞 + /// </summary> + protected Func<T, object, WebResponseContent> AddOnExecuted; + + /// <summary> + /// 杩涘叆瀹℃壒娴佺▼鏂规硶涔嬪墠 + /// </summary> + protected Func<T, bool> AddWorkFlowExecuting; + + /// <summary> + /// 鍐欏叆瀹℃壒娴佺▼鏁版嵁涔嬪悗 + /// list:瀹℃壒鐨勪汉id + /// </summary> + protected Action<T, List<int>> AddWorkFlowExecuted; + + /// <summary> + /// 璋冪敤鏇存柊鏂规硶鍓嶅鐞�(SaveModel涓轰紶鍏ョ殑鍘熺敓鏁版嵁) + /// </summary> + protected Func<SaveModel, WebResponseContent> UpdateOnExecute; + + /// <summary> + /// 璋冪敤鏇存柊鏂规硶鍓嶅鐞�(SaveModel涓轰紶鍏ョ殑鍘熺敓鏁版嵁) + /// </summary> + protected Func<SaveModel, List<string>> UpdateIgnoreColOnExecute; + + /// <summary> + /// 璋冪敤鏇存柊鏂规硶淇濆瓨鏁版嵁搴撳墠澶勭悊 + /// (宸插皢鎻愪氦鐨勫師鐢熸暟鎹浆鎹㈡垚浜嗗璞�,灏嗘槑缁嗘柊澧炪�佷慨鏀广�佸垹闄ょ殑鏁版嵁鍒嗗埆鐢╫bject1/2/3鏍囪瘑鍑烘潵 ) + /// T=鏇存柊鐨勪富琛ㄥ璞� + /// object1=涓烘柊澧炴槑缁嗙殑瀵硅薄锛屼娇鐢ㄦ椂灏唎bject as List<T>杞崲涓�涓� + /// object2=涓烘洿鏂版槑缁嗙殑瀵硅薄 + /// List<object>=涓哄垹闄ょ殑缁嗙殑瀵硅薄Key + /// </summary> + protected Func<T, object, object, List<object>, WebResponseContent> UpdateOnExecuting; + + /// <summary> + /// 璋冪敤鏇存柊鏂规硶淇濆瓨鏁版嵁搴撳悗澶勭悊 + /// **瀹炵幇褰撳墠鏂规硶鏃讹紝鍐呴儴榛樿宸茬粡寮�鍚簨鍔★紝濡傛灉瀹炵幇鐨勬柟娉曟搷浣滅殑鏄悓涓�鏁版嵁搴�,鍒欎笉闇�瑕佸湪UpdateOnExecuted涓簨鍔� + /// (宸插皢鎻愪氦鐨勫師鐢熸暟鎹浆鎹㈡垚浜嗗璞�,灏嗘槑缁嗘柊澧炪�佷慨鏀广�佸垹闄ょ殑鏁版嵁鍒嗗埆鐢╫bject1/2/3鏍囪瘑鍑烘潵 ) + /// T=鏇存柊鐨勪富琛ㄥ璞� + /// object1=涓烘柊澧炴槑缁嗙殑瀵硅薄锛屼娇鐢ㄦ椂灏唎bject as List<T>杞崲涓�涓� + /// object2=涓烘洿鏂版槑缁嗙殑瀵硅薄 + /// List<object>=涓哄垹闄ょ殑缁嗙殑瀵硅薄Key + /// 姝ゅ宸插紑鍚簡DbContext浜嬪姟(閲嶇偣),濡傛灉杩樻湁鍏朵粬涓氬姟澶勪簨锛岀洿鎺ュ湪杩欓噷鍐橢F浠g爜,涓嶉渶瑕佸啀寮�鍚簨鍔� + /// 濡傛灉鎵ц鐨勬槸鎵嬪啓sql璇风敤repository.DbContext.Database.ExecuteSqlCommand()鎴� repository.DbContext.Set<T>().FromSql鎵ц鍏蜂綋sql璇彞 + /// </summary> + protected Func<T, object, object, List<object>, WebResponseContent> UpdateOnExecuted; + + /// <summary> + /// 鍒犻櫎鍓嶅鐞�,object[]鍑嗗鍒犻櫎鐨勪富閿� + /// </summary> + protected Func<object[], WebResponseContent> DelOnExecuting; + + /// <summary> + /// 鍒犻櫎鍚庡鐞�,object[]宸插垹闄ょ殑涓婚敭,姝ゅ宸插紑鍚簡DbContext浜嬪姟(閲嶇偣),濡傛灉杩樻湁鍏朵粬涓氬姟澶勪簨锛岀洿鎺ュ湪杩欓噷鍐橢F浠g爜,涓嶉渶瑕佸啀寮�鍚簨鍔� + /// 濡傛灉鎵ц鐨勬槸鎵嬪啓sql璇风敤repository.DbContext.Database.ExecuteSqlCommand()鎴� repository.DbContext.Set<T>().FromSql鎵ц鍏蜂綋sql璇彞 + /// </summary> + protected Func<object[], WebResponseContent> DelOnExecuted; + + /// <summary> + /// 瀹℃牳鍓嶅鐞� + /// </summary> + protected Func<List<T>, WebResponseContent> AuditOnExecuting; + /// <summary> + /// 瀹℃牳鍚庡鐞� + /// </summary> + protected Func<List<T>, WebResponseContent> AuditOnExecuted; + + + /// <summary> + ///瀵煎嚭鍓嶅鐞�,DataTable瀵煎嚭鐨勮〃鏁版嵁 + ///List<T>瀵煎嚭鐨勬暟鎹�, List<string>蹇界暐涓嶉渶瑕佸鍑虹殑瀛楁 + ///姝ゆ柟娉曚笉寤鸿浣跨敤,鐢变笅闈xportColumns濮旀墭鏇夸唬2020.05.07 + /// </summary> + protected Func<List<T>, List<string>, WebResponseContent> ExportOnExecuting; + + /// <summary> + /// 2020.05.07 + /// 瀵煎嚭琛ㄦ暟鎹�(鐣岄潰涓婂鍑烘搷浣�),鎸囧畾瑕佸鍑虹殑鍒楋紝鏍煎紡:Expression<Func<T, object>> exp = x => new { x.瀛楁1, x.瀛楁2 } + /// </summary> + protected Expression<Func<T, object>> ExportColumns { get; set; } + + + /// <summary> + /// 2020.05.07 + /// 瀵煎嚭涓嬭浇妯℃澘锛屾寚瀹氳瀵煎嚭鐨勬ā鏉垮垪锛屾牸寮�:Expression<Func<T, object>> exp = x => new { x.瀛楁1, x.瀛楁2 } + /// </summary> + protected Expression<Func<T, object>> DownLoadTemplateColumns { get; set; } + + + /// <summary> + /// 瀵煎叆淇濆瓨鍚� + /// </summary> + protected Func<List<T>, WebResponseContent> ImportOnExecuted; + + /// <summary> + /// 瀵煎叆淇濆瓨鍓� + /// </summary> + protected Func<List<T>, WebResponseContent> ImportOnExecuting; + + /// <summary> + /// 瀵煎叆鏃朵笉楠岃瘉涓嬫媺妗嗘暟鎹簮鐨勫瓧娈靛��2023.05.03 + /// </summary> + protected Expression<Func<T, object>> ImportIgnoreSelectValidationColumns; + + /// <summary> + /// 2022.06.20澧炲姞鍘熺敓excel璇诲彇鏂规硶(瀵煎叆鏃跺彲浠ヨ嚜瀹氫箟璇诲彇excel鍐呭) + /// string=褰撳墠璇诲彇鐨別xcel鍗曞厓鏍肩殑鍊� + /// ExcelWorksheet=excel瀵硅薄 + /// ExcelRange褰撳墠excel鍗曞厓鏍煎璞� + /// int=褰撳墠璇诲彇鐨勭鍑犳暟 + /// int=褰撳墠璇诲彇鐨勭鍑犲垪 + /// string=杩斿洖鐨勫�� + /// </summary> + //protected Func<string, ExcelWorksheet, ExcelRange, int, int, string> ImportOnReadCellValue; + + + /// <summary> + /// 鑷畾涔変笂浼犳枃浠跺す(2022.10.07) + /// </summary> + protected string UploadFolder = null; + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Caches/Caching.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Caches/Caching.cs" new file mode 100644 index 0000000..fff2699 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Caches/Caching.cs" @@ -0,0 +1,351 @@ +锘縰sing Microsoft.Extensions.Caching.Distributed; +using Microsoft.Extensions.Caching.Memory; +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Core.Const; + +namespace WIDESEA_Core.Caches +{ + /// <summary> + /// 瀹炰緥鍖栫紦瀛樻帴鍙Caching + /// </summary> + public class Caching : ICaching + { + private readonly IDistributedCache _cache; + + public Caching(IDistributedCache cache) + { + _cache = cache; + } + + private byte[] GetBytes<T>(T source) + { + return Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(source)); + } + + public IDistributedCache Cache => _cache; + + public void AddCacheKey(string cacheKey) + { + var res = _cache.GetString(CacheConst.KeyAll); + var allkeys = string.IsNullOrWhiteSpace(res) ? new List<string>() : JsonConvert.DeserializeObject<List<string>>(res); + if (!allkeys.Any(m => m == cacheKey)) + { + allkeys.Add(cacheKey); + _cache.SetString(CacheConst.KeyAll, JsonConvert.SerializeObject(allkeys)); + } + } + + /// <summary> + /// 澧炲姞缂撳瓨Key + /// </summary> + /// <param name="cacheKey"></param> + /// <returns></returns> + public async Task AddCacheKeyAsync(string cacheKey) + { + var res = await _cache.GetStringAsync(CacheConst.KeyAll); + var allkeys = string.IsNullOrWhiteSpace(res) ? new List<string>() : JsonConvert.DeserializeObject<List<string>>(res); + if (!allkeys.Any(m => m == cacheKey)) + { + allkeys.Add(cacheKey); + await _cache.SetStringAsync(CacheConst.KeyAll, JsonConvert.SerializeObject(allkeys)); + } + } + + public void DelByPattern(string key) + { + var allkeys = GetAllCacheKeys(); + if (allkeys == null) return; + + var delAllkeys = allkeys.Where(u => u.Contains(key)).ToList(); + delAllkeys.ForEach(u => { _cache.Remove(u); }); + + // 鏇存柊鎵�鏈夌紦瀛橀敭 + allkeys = allkeys.Where(u => !u.Contains(key)).ToList(); + _cache.SetString(CacheConst.KeyAll, JsonConvert.SerializeObject(allkeys)); + } + + /// <summary> + /// 鍒犻櫎鏌愮壒寰佸叧閿瓧缂撳瓨 + /// </summary> + /// <param name="key"></param> + /// <returns></returns> + public async Task DelByPatternAsync(string key) + { + var allkeys = await GetAllCacheKeysAsync(); + if (allkeys == null) return; + + var delAllkeys = allkeys.Where(u => u.Contains(key)).ToList(); + delAllkeys.ForEach(u => { _cache.Remove(u); }); + + // 鏇存柊鎵�鏈夌紦瀛橀敭 + allkeys = allkeys.Where(u => !u.Contains(key)).ToList(); + await _cache.SetStringAsync(CacheConst.KeyAll, JsonConvert.SerializeObject(allkeys)); + } + + public void DelCacheKey(string cacheKey) + { + var res = _cache.GetString(CacheConst.KeyAll); + var allkeys = string.IsNullOrWhiteSpace(res) ? new List<string>() : JsonConvert.DeserializeObject<List<string>>(res); + if (allkeys.Any(m => m == cacheKey)) + { + allkeys.Remove(cacheKey); + _cache.SetString(CacheConst.KeyAll, JsonConvert.SerializeObject(allkeys)); + } + } + + /// <summary> + /// 鍒犻櫎缂撳瓨 + /// </summary> + /// <param name="cacheKey"></param> + /// <returns></returns> + public async Task DelCacheKeyAsync(string cacheKey) + { + var res = await _cache.GetStringAsync(CacheConst.KeyAll); + var allkeys = string.IsNullOrWhiteSpace(res) ? new List<string>() : JsonConvert.DeserializeObject<List<string>>(res); + if (allkeys.Any(m => m == cacheKey)) + { + allkeys.Remove(cacheKey); + await _cache.SetStringAsync(CacheConst.KeyAll, JsonConvert.SerializeObject(allkeys)); + } + } + + public bool Exists(string cacheKey) + { + var res = _cache.Get(cacheKey); + return res != null; + } + + /// <summary> + /// 妫�鏌ョ粰瀹� key 鏄惁瀛樺湪 + /// </summary> + /// <param name="cacheKey">閿�</param> + /// <returns></returns> + public async Task<bool> ExistsAsync(string cacheKey) + { + var res = await _cache.GetAsync(cacheKey); + return res != null; + } + + public List<string> GetAllCacheKeys() + { + var res = _cache.GetString(CacheConst.KeyAll); + return string.IsNullOrWhiteSpace(res) ? null : JsonConvert.DeserializeObject<List<string>>(res); + } + + /// <summary> + /// 鑾峰彇鎵�鏈夌紦瀛樺垪琛� + /// </summary> + /// <returns></returns> + public async Task<List<string>> GetAllCacheKeysAsync() + { + var res = await _cache.GetStringAsync(CacheConst.KeyAll); + return string.IsNullOrWhiteSpace(res) ? null : JsonConvert.DeserializeObject<List<string>>(res); + } + + public T Get<T>(string cacheKey) + { + var res = _cache.Get(cacheKey); + return res == null ? default : JsonConvert.DeserializeObject<T>(Encoding.UTF8.GetString(res)); + } + + /// <summary> + /// 鑾峰彇缂撳瓨 + /// </summary> + /// <typeparam name="T"></typeparam> + /// <param name="cacheKey"></param> + /// <returns></returns> + public async Task<T> GetAsync<T>(string cacheKey) + { + var res = await _cache.GetAsync(cacheKey); + return res == null ? default : JsonConvert.DeserializeObject<T>(Encoding.UTF8.GetString(res)); + } + + public object Get(Type type, string cacheKey) + { + var res = _cache.Get(cacheKey); + return res == null ? default : JsonConvert.DeserializeObject(Encoding.UTF8.GetString(res), type); + } + + public async Task<object> GetAsync(Type type, string cacheKey) + { + var res = await _cache.GetAsync(cacheKey); + return res == null ? default : JsonConvert.DeserializeObject(Encoding.UTF8.GetString(res), type); + } + + public string GetString(string cacheKey) + { + return _cache.GetString(cacheKey); + } + + /// <summary> + /// 鑾峰彇缂撳瓨 + /// </summary> + /// <param name="cacheKey"></param> + /// <returns></returns> + public async Task<string> GetStringAsync(string cacheKey) + { + return await _cache.GetStringAsync(cacheKey); + } + + public void Remove(string key) + { + _cache.Remove(key); + DelCacheKey(key); + } + + /// <summary> + /// 鍒犻櫎缂撳瓨 + /// </summary> + /// <param name="key"></param> + /// <returns></returns> + public async Task RemoveAsync(string key) + { + await _cache.RemoveAsync(key); + await DelCacheKeyAsync(key); + } + + public void RemoveAll() + { + var catches = GetAllCacheKeys(); + foreach (var @catch in catches) Remove(@catch); + + catches.Clear(); + _cache.SetString(CacheConst.KeyAll, JsonConvert.SerializeObject(catches)); + } + + public async Task RemoveAllAsync() + { + var catches = await GetAllCacheKeysAsync(); + foreach (var @catch in catches) await RemoveAsync(@catch); + + catches.Clear(); + await _cache.SetStringAsync(CacheConst.KeyAll, JsonConvert.SerializeObject(catches)); + } + + + public void Set<T>(string cacheKey, T value, TimeSpan? expire = null) + { + _cache.Set(cacheKey, GetBytes(value), + expire == null + ? new DistributedCacheEntryOptions() { AbsoluteExpirationRelativeToNow = TimeSpan.FromHours(6) } + : new DistributedCacheEntryOptions() { AbsoluteExpirationRelativeToNow = expire }); + + AddCacheKey(cacheKey); + } + + /// <summary> + /// 澧炲姞瀵硅薄缂撳瓨 + /// </summary> + /// <param name="cacheKey"></param> + /// <param name="value"></param> + /// <returns></returns> + public async Task SetAsync<T>(string cacheKey, T value) + { + await _cache.SetAsync(cacheKey, Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(value)), + new DistributedCacheEntryOptions() { AbsoluteExpirationRelativeToNow = TimeSpan.FromHours(6) }); + + await AddCacheKeyAsync(cacheKey); + } + + /// <summary> + /// 澧炲姞瀵硅薄缂撳瓨,骞惰缃繃鏈熸椂闂� + /// </summary> + /// <param name="cacheKey"></param> + /// <param name="value"></param> + /// <param name="expire"></param> + /// <returns></returns> + public async Task SetAsync<T>(string cacheKey, T value, TimeSpan expire) + { + await _cache.SetAsync(cacheKey, Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(value)), + new DistributedCacheEntryOptions() { AbsoluteExpirationRelativeToNow = expire }); + + await AddCacheKeyAsync(cacheKey); + } + + public void SetPermanent<T>(string cacheKey, T value) + { + _cache.Set(cacheKey, Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(value))); + AddCacheKey(cacheKey); + } + + public async Task SetPermanentAsync<T>(string cacheKey, T value) + { + await _cache.SetAsync(cacheKey, Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(value))); + await AddCacheKeyAsync(cacheKey); + } + + public void SetString(string cacheKey, string value, TimeSpan? expire = null) + { + if (expire == null) + _cache.SetString(cacheKey, value, new DistributedCacheEntryOptions() { AbsoluteExpirationRelativeToNow = TimeSpan.FromHours(6) }); + else + _cache.SetString(cacheKey, value, new DistributedCacheEntryOptions() { AbsoluteExpirationRelativeToNow = expire }); + + AddCacheKey(cacheKey); + } + + /// <summary> + /// 澧炲姞瀛楃涓茬紦瀛� + /// </summary> + /// <param name="cacheKey"></param> + /// <param name="value"></param> + /// <returns></returns> + public async Task SetStringAsync(string cacheKey, string value) + { + await _cache.SetStringAsync(cacheKey, value, new DistributedCacheEntryOptions() { AbsoluteExpirationRelativeToNow = TimeSpan.FromHours(6) }); + + await AddCacheKeyAsync(cacheKey); + } + + /// <summary> + /// 澧炲姞瀛楃涓茬紦瀛�,骞惰缃繃鏈熸椂闂� + /// </summary> + /// <param name="cacheKey"></param> + /// <param name="value"></param> + /// <param name="expire"></param> + /// <returns></returns> + public async Task SetStringAsync(string cacheKey, string value, TimeSpan expire) + { + await _cache.SetStringAsync(cacheKey, value, new DistributedCacheEntryOptions() { AbsoluteExpirationRelativeToNow = expire }); + + await AddCacheKeyAsync(cacheKey); + } + + + /// <summary> + /// 缂撳瓨鏈�澶ц鑹叉暟鎹寖鍥� + /// </summary> + /// <param name="userId"></param> + /// <param name="dataScopeType"></param> + /// <returns></returns> + public async Task SetMaxDataScopeType(long userId, int dataScopeType) + { + var cacheKey = CacheConst.KeyMaxDataScopeType + userId; + await SetStringAsync(cacheKey, dataScopeType.ToString()); + + await AddCacheKeyAsync(cacheKey); + } + + /// <summary> + /// 鏍规嵁鐖堕敭娓呯┖ + /// </summary> + /// <param name="key"></param> + /// <returns></returns> + public async Task DelByParentKeyAsync(string key) + { + var allkeys = await GetAllCacheKeysAsync(); + if (allkeys == null) return; + + var delAllkeys = allkeys.Where(u => u.StartsWith(key)).ToList(); + delAllkeys.ForEach(Remove); + // 鏇存柊鎵�鏈夌紦瀛橀敭 + allkeys = allkeys.Where(u => !u.StartsWith(key)).ToList(); + await SetStringAsync(CacheConst.KeyAll, JsonConvert.SerializeObject(allkeys)); + } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Caches/ICaching.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Caches/ICaching.cs" new file mode 100644 index 0000000..052615c --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Caches/ICaching.cs" @@ -0,0 +1,59 @@ +锘縰sing Microsoft.Extensions.Caching.Distributed; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WIDESEA_Core.Caches +{ + /// <summary> + /// 缂撳瓨鎶借薄鎺ュ彛,鍩轰簬IDistributedCache灏佽 + /// </summary> + public interface ICaching + { + public IDistributedCache Cache { get; } + void AddCacheKey(string cacheKey); + Task AddCacheKeyAsync(string cacheKey); + + void DelByPattern(string key); + Task DelByPatternAsync(string key); + + void DelCacheKey(string cacheKey); + Task DelCacheKeyAsync(string cacheKey); + + bool Exists(string cacheKey); + Task<bool> ExistsAsync(string cacheKey); + + List<string> GetAllCacheKeys(); + Task<List<string>> GetAllCacheKeysAsync(); + + T Get<T>(string cacheKey); + Task<T> GetAsync<T>(string cacheKey); + + object Get(Type type, string cacheKey); + Task<object> GetAsync(Type type, string cacheKey); + + string GetString(string cacheKey); + Task<string> GetStringAsync(string cacheKey); + + void Remove(string key); + Task RemoveAsync(string key); + + void RemoveAll(); + Task RemoveAllAsync(); + + void Set<T>(string cacheKey, T value, TimeSpan? expire = null); + Task SetAsync<T>(string cacheKey, T value); + Task SetAsync<T>(string cacheKey, T value, TimeSpan expire); + + void SetPermanent<T>(string cacheKey, T value); + Task SetPermanentAsync<T>(string cacheKey, T value); + + void SetString(string cacheKey, string value, TimeSpan? expire = null); + Task SetStringAsync(string cacheKey, string value); + Task SetStringAsync(string cacheKey, string value, TimeSpan expire); + + Task DelByParentKeyAsync(string key); + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Caches/SqlSugarCacheService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Caches/SqlSugarCacheService.cs" new file mode 100644 index 0000000..4b6d04d --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Caches/SqlSugarCacheService.cs" @@ -0,0 +1,69 @@ +锘縰sing Microsoft.Extensions.Caching.Memory; +using SqlSugar; +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using System.Text; +using System.Threading.Tasks; + +namespace WIDESEA_Core.Caches +{ + /// <summary> + /// 瀹炵幇SqlSugar鐨処CacheService鎺ュ彛 + /// </summary> + public class SqlSugarCacheService : ICacheService + { + private readonly Lazy<ICaching> _caching = new(() => App.GetService<ICaching>(false)); + private ICaching Caching => _caching.Value; + + public void Add<V>(string key, V value) + { + Caching.Set(key, value); + } + + public void Add<V>(string key, V value, int cacheDurationInSeconds) + { + Caching.Set(key, value, TimeSpan.FromSeconds(cacheDurationInSeconds)); + } + + public bool ContainsKey<V>(string key) + { + return Caching.Exists(key); + } + + public V Get<V>(string key) + { + return Caching.Get<V>(key); + } + + public IEnumerable<string> GetAllKey<V>() + { + return Caching.GetAllCacheKeys(); + } + + public V GetOrCreate<V>(string cacheKey, Func<V> create, int cacheDurationInSeconds = int.MaxValue) + { + if (!ContainsKey<V>(cacheKey)) + { + var value = create(); + Caching.Set(cacheKey, value, TimeSpan.FromSeconds(cacheDurationInSeconds)); + return value; + } + + return Caching.Get<V>(cacheKey); + } + + public void Remove<V>(string key) + { + Caching.Remove(key); + } + + public bool RemoveAll() + { + Caching.RemoveAll(); + return true; + } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Const/AppSecret.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Const/AppSecret.cs" new file mode 100644 index 0000000..8760498 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Const/AppSecret.cs" @@ -0,0 +1,29 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WIDESEA_Core.Const +{ + /// <summary> + /// 绉橀挜閰嶇疆 + /// </summary> + public struct AppSecret + { + public const string JWT = "BB3647441FFA4B5DB4E64A29B53CE525"; + + public const string Audience = "WIDESEA_WMS"; + + public const string Issuer = "WIDESEA_WMS_Owner"; + + public const string TokenHeaderName = "Authorization"; + + public const string User = "C5ABA9E202D94C43A3CA66002BF77FAF"; + + public const string DB = "3F8B7B38AD3D484A89ACA513CBD79F36"; + + //杩炴帴瀛楃涓� + //Data Source=.;Initial Catalog=WIDESEA_DB_2;User ID=sa;Password=P@ssw0rd;Integrated Security=True;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Const/CacheConst.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Const/CacheConst.cs" new file mode 100644 index 0000000..841d5d2 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Const/CacheConst.cs" @@ -0,0 +1,94 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WIDESEA_Core.Const +{ + /// <summary> + /// 缂撳瓨鐩稿叧甯搁噺 + /// </summary> + public class CacheConst + { + /// <summary> + /// 鐢ㄦ埛缂撳瓨 + /// </summary> + public const string KeyUser = "user:"; + + /// <summary> + /// 鐢ㄦ埛閮ㄩ棬缂撳瓨 + /// </summary> + public const string KeyUserDepart = "userDepart:"; + + /// <summary> + /// 鑿滃崟缂撳瓨 + /// </summary> + public const string KeyMenu = "menu:"; + + /// <summary> + /// 鑿滃崟 + /// </summary> + public const string KeyPermissions = "permissions"; + + /// <summary> + /// 鏉冮檺缂撳瓨 + /// </summary> + public const string KeyPermission = "permission:"; + + /// <summary> + /// 鎺ュ彛璺敱 + /// </summary> + public const string KeyModules = "modules"; + + /// <summary> + /// 绯荤粺閰嶇疆 + /// </summary> + public const string KeySystemConfig = "sysConfig"; + + /// <summary> + /// 鏌ヨ杩囨护鍣ㄧ紦瀛� + /// </summary> + public const string KeyQueryFilter = "queryFilter:"; + + /// <summary> + /// 鏈烘瀯Id闆嗗悎缂撳瓨 + /// </summary> + public const string KeyOrgIdList = "org:"; + + /// <summary> + /// 鏈�澶ц鑹叉暟鎹寖鍥寸紦瀛� + /// </summary> + public const string KeyMaxDataScopeType = "maxDataScopeType:"; + + /// <summary> + /// 楠岃瘉鐮佺紦瀛� + /// </summary> + public const string KeyVerCode = "verCode:"; + + /// <summary> + /// 鎵�鏈夌紦瀛樺叧閿瓧闆嗗悎 + /// </summary> + public const string KeyAll = "keys"; + + /// <summary> + /// 瀹氭椂浠诲姟缂撳瓨 + /// </summary> + public const string KeyTimer = "timer:"; + + /// <summary> + /// 鍦ㄧ嚎鐢ㄦ埛缂撳瓨 + /// </summary> + public const string KeyOnlineUser = "onlineuser:"; + + /// <summary> + /// 甯搁噺涓嬫媺妗� + /// </summary> + public const string KeyConstSelector = "selector:"; + + /// <summary> + /// swagger鐧诲綍缂撳瓨 + /// </summary> + public const string SwaggerLogin = "swaggerLogin:"; + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Const/ConfigConst.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Const/ConfigConst.cs" new file mode 100644 index 0000000..3e0e8e7 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Const/ConfigConst.cs" @@ -0,0 +1,100 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WIDESEA_Core.Const +{ + /// <summary> + /// 鍒嗙被甯搁噺 + /// </summary> + public class CateGoryConst + { + /// <summary> + /// 閭鍩虹 + /// </summary> + public const string CONFIG_SYS_BaseExmail = "Sys_BaseExmail"; + + /// <summary> + /// 閭閰嶇疆 + /// </summary> + public const string CONFIG_SYS_RegExmail = "Sys_RegExmail"; + + /// <summary> + /// IP鎺ュ彛鍦板潃 + /// </summary> + public const string CONFIG_SYS_IPAddress = "SYS_IPAddress"; + + public const string CONFIG_SYS_Parameters = "SYS_Parameters"; + } + + /// <summary> + /// 閰嶇疆Key甯搁噺 + /// </summary> + public class SysConfigConst + { + /// <summary> + /// 閭SMTP鍦板潃 + /// </summary> + public const string SMTP_Server = "smtpServer"; + + /// <summary> + /// 閭SMTP绔彛 + /// </summary> + public const string SMTP_Port = "smtpPort"; + + /// <summary> + /// 閭SMTP璐﹀彿 + /// </summary> + public const string SMTP_User = "smtpUser"; + + /// <summary> + /// 閭SMTP瀵嗙爜 + /// </summary> + public const string SMTP_Pass = "smtpPass"; + + /// <summary> + /// 閭鏍囬 + /// </summary> + public const string SMTP_Title = "smtpTitle"; + + /// <summary> + /// 閭鍐呭鏍囬 + /// </summary> + public const string SMTP_ContentTitle = "smtpContentTitle"; + + /// <summary> + /// 閭鍐呭鏍囬 + /// </summary> + public const string SMTP_RegUser = "smtpRegUser"; + + /// <summary> + /// WCS IP + /// </summary> + public const string WCSIPAddress = "WCSIPAddress"; + + /// <summary> + /// 璇锋眰WCS浠诲姟 + /// </summary> + public const string ReceiveWMSTask = "ReceiveWMSTask"; + + /// <summary> + /// 璇锋眰WCS浠诲姟 + /// </summary> + public const string ReceiveByWMSTask = "ReceiveByWMSTask"; + + /// <summary> + /// 璇锋眰WCS浠诲姟 + /// </summary> + public const string ReceiveTask = "ReceiveTask"; + + /// <summary> + /// 璇锋眰WCS浠诲姟 + /// </summary> + public const string GetStation = "GetStation"; + + public const string TempHour = "TempHour"; + + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Const/ErrorMsgConst.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Const/ErrorMsgConst.cs" new file mode 100644 index 0000000..3456c44 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Const/ErrorMsgConst.cs" @@ -0,0 +1,15 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WIDESEA_Core.Const +{ + public class ErrorMsgConst + { + public const string ParamIsNull = "鍙傛暟鏃犳晥"; + public const string EntityValueIsNull = "涓哄繀椤绘彁浜ら」"; + public const string SugarColumnIsNull = "璇烽厤缃甋ugarColumn灞炴��"; + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Const/HtmlElementType.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Const/HtmlElementType.cs" new file mode 100644 index 0000000..735718d --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Const/HtmlElementType.cs" @@ -0,0 +1,32 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WIDESEA_Core.Const +{ + public struct HtmlElementType + { + public const string drop = "drop"; + public const string droplist = "droplist"; + public const string select = "select"; + public const string selectlist = "selectlist"; + public const string checkbox = "checkbox"; + public const string textarea = "textarea"; + public const string thanorequal = "thanorequal"; + public const string lessorequal = "lessorequal"; + + + public const string gt = "gt"; + public const string lt = "lt"; + public const string GT = ">"; + public const string LT = "<"; + public const string like = "like"; + + public const string ThanOrEqual = ">="; + public const string LessOrequal = "<="; + public const string Contains = "in"; + public const string Equal = "="; + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Const/SqlDbTypeName.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Const/SqlDbTypeName.cs" new file mode 100644 index 0000000..b12f10d --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Const/SqlDbTypeName.cs" @@ -0,0 +1,29 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WIDESEA_Core.Const +{ + public struct SqlDbTypeName + { + public const string NVarChar = "nvarchar"; + public const string VarChar = "varchar"; + public const string NChar = "nchar"; + public const string Char = "char"; + public const string Text = "text"; + public const string Int = "int"; + public const string BigInt = "bigint"; + public const string DateTime = "datetime"; + public const string Date = "date"; + public const string SmallDateTime = "smalldatetime"; + public const string SmallDate = "smalldate"; + public const string Float = "float"; + public const string Decimal = "decimal"; + public const string Double = "double"; + public const string Bit = "bit"; + public const string Bool = "bool"; + public const string UniqueIdentifier = "uniqueidentifier"; + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Const/TenantConst.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Const/TenantConst.cs" new file mode 100644 index 0000000..eeeeae4 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Const/TenantConst.cs" @@ -0,0 +1,13 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WIDESEA_Core.Const +{ + public class TenantConst + { + public const string DBConStr = "Data Source={0};Initial Catalog={1};User ID={2};Password={3};Integrated Security=True;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False"; + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Const/TenantStatus.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Const/TenantStatus.cs" new file mode 100644 index 0000000..581b035 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Const/TenantStatus.cs" @@ -0,0 +1,14 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WIDESEA_Core.Const +{ + public struct TenantStatus + { + public const int Enable = 1; + public const int Disable = 2; + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Core/ConfigurableOptions.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Core/ConfigurableOptions.cs" new file mode 100644 index 0000000..a313a78 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Core/ConfigurableOptions.cs" @@ -0,0 +1,66 @@ +锘縰sing Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Options; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WIDESEA_Core.Core +{ + public static class ConfigurableOptions + { + /// <summary>娣诲姞閫夐」閰嶇疆</summary> + /// <typeparam name="TOptions">閫夐」绫诲瀷</typeparam> + /// <param name="services">鏈嶅姟闆嗗悎</param> + /// <returns>鏈嶅姟闆嗗悎</returns> + public static IServiceCollection AddConfigurableOptions<TOptions>(this IServiceCollection services) + where TOptions : class, IConfigurableOptions + { + Type optionsType = typeof(TOptions); + string path = GetConfigurationPath(optionsType); + services.Configure<TOptions>(App.Configuration.GetSection(path)); + + return services; + } + + public static IServiceCollection AddConfigurableOptions(this IServiceCollection services, Type type) + { + string path = GetConfigurationPath(type); + var config = App.Configuration.GetSection(path); + + Type iOptionsChangeTokenSource = typeof(IOptionsChangeTokenSource<>); + Type iConfigureOptions = typeof(IConfigureOptions<>); + Type configurationChangeTokenSource = typeof(ConfigurationChangeTokenSource<>); + Type namedConfigureFromConfigurationOptions = typeof(NamedConfigureFromConfigurationOptions<>); + iOptionsChangeTokenSource = iOptionsChangeTokenSource.MakeGenericType(type); + iConfigureOptions = iConfigureOptions.MakeGenericType(type); + configurationChangeTokenSource = configurationChangeTokenSource.MakeGenericType(type); + namedConfigureFromConfigurationOptions = namedConfigureFromConfigurationOptions.MakeGenericType(type); + + services.AddOptions(); + services.AddSingleton(iOptionsChangeTokenSource, + Activator.CreateInstance(configurationChangeTokenSource, Options.DefaultName, config) ?? throw new InvalidOperationException()); + return services.AddSingleton(iConfigureOptions, + Activator.CreateInstance(namedConfigureFromConfigurationOptions, Options.DefaultName, config) ?? throw new InvalidOperationException()); + } + + /// <summary>鑾峰彇閰嶇疆璺緞</summary> + /// <param name="optionsType">閫夐」绫诲瀷</param> + /// <returns></returns> + public static string GetConfigurationPath(Type optionsType) + { + var endPath = new[] { "Option", "Options" }; + var configurationPath = optionsType.Name; + foreach (var s in endPath) + { + if (configurationPath.EndsWith(s)) + { + return configurationPath[..^s.Length]; + } + } + + return configurationPath; + } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Core/IConfigurableOptions.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Core/IConfigurableOptions.cs" new file mode 100644 index 0000000..a891834 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Core/IConfigurableOptions.cs" @@ -0,0 +1,12 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WIDESEA_Core.Core +{ + public interface IConfigurableOptions + { + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Core/InternalApp.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Core/InternalApp.cs" new file mode 100644 index 0000000..5dfff8e --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Core/InternalApp.cs" @@ -0,0 +1,47 @@ +锘縰sing Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WIDESEA_Core.Core +{ + public static class InternalApp + { + internal static IServiceCollection InternalServices; + + /// <summary>鏍规湇鍔�</summary> + internal static IServiceProvider RootServices; + + /// <summary>鑾峰彇Web涓绘満鐜</summary> + internal static IWebHostEnvironment WebHostEnvironment; + + /// <summary>鑾峰彇娉涘瀷涓绘満鐜</summary> + internal static IHostEnvironment HostEnvironment; + + /// <summary>閰嶇疆瀵硅薄</summary> + internal static IConfiguration Configuration; + + public static void ConfigureApplication(this WebApplicationBuilder wab) + { + HostEnvironment = wab.Environment; + WebHostEnvironment = wab.Environment; + InternalServices = wab.Services; + } + + public static void ConfigureApplication(this IConfiguration configuration) + { + Configuration = configuration; + } + + public static void ConfigureApplication(this IHost app) + { + RootServices = app.Services; + } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/DB/BaseDBConfig.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/DB/BaseDBConfig.cs" new file mode 100644 index 0000000..ed0e254 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/DB/BaseDBConfig.cs" @@ -0,0 +1,121 @@ +锘縰sing SqlSugar; +using System; +using System.Collections.Generic; +using System.Dynamic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Core.Const; +using WIDESEA_Core.Helper; +using WIDESEA_Core.Tenants; + +namespace WIDESEA_Core.DB +{ + public class BaseDBConfig + { + /* 涔嬪墠鐨勫崟搴撴搷浣滃凡缁忓垹闄わ紝濡傛灉鎯宠涔嬪墠鐨勪唬鐮侊紝鍙互鏌ョ湅鎴戠殑GitHub鐨勫巻鍙茶褰� + * 鐩墠鏄搴撴搷浣滐紝榛樿鍔犺浇鐨勬槸appsettings.json璁剧疆涓簍rue鐨勭涓�涓猟b杩炴帴銆� + */ + public static List<MutiDBOperate> MutiConnectionString => MutiInitConn(); + + private static string DifDBConnOfSecurity(params string[] conn) + { + foreach (var item in conn) + { + try + { + if (File.Exists(item)) + { + return File.ReadAllText(item).Trim(); + } + } + catch (System.Exception) + { + } + } + + return conn[conn.Length - 1]; + } + + public static List<MutiDBOperate> MutiInitConn() + { + SqlSugarClient sqlSugarClient = new SqlSugarClient(new ConnectionConfig + { + ConfigId = MainDb.CurrentDbConnId, + ConnectionString = AppSettings.app(MainDb.ConnectionString).DecryptDES(AppSecret.DB), + IsAutoCloseConnection = true, + DbType = MainDb.DbType, + AopEvents = new AopEvents + { + OnError = x => + { + Console.WriteLine(x.Sql); + } + } + }); + + List<ExpandoObject> list = sqlSugarClient.Queryable(MainDb.TenantTableName, "x").Where(MainDb.TenantStatus, "=", TenantStatus.Enable).Select(TenantUtil.GetTenantSelectModels()).ToList(); + List<MutiDBOperate> listdatabaseSlaveDB = new List<MutiDBOperate>(); + MutiDBOperate mainDb = new MutiDBOperate() + { + Connection = AppSettings.app(MainDb.ConnectionString).DecryptDES(AppSecret.DB), + ConnId = MainDb.CurrentDbConnId, + DbType = DataBaseType.SqlServer + }; + listdatabaseSlaveDB.Add(mainDb); + for (int i = 0; i < list.Count; i++) + { + dynamic data = list[i]; + MutiDBOperate mutiDBOperate = new MutiDBOperate() + { + Connection = data.ConnectionString, + ConnId = data.TenantId + "", + DbType = (DataBaseType)data.DbType, + }; + mutiDBOperate.Connection = mutiDBOperate.Connection.DecryptDES(AppSecret.DB); + listdatabaseSlaveDB.Add(mutiDBOperate); + } + + return listdatabaseSlaveDB; + } + } + + public enum DataBaseType + { + MySql = 0, + SqlServer = 1, + Sqlite = 2, + Oracle = 3, + PostgreSQL = 4, + Dm = 5, + Kdbndp = 6, + } + + public class MutiDBOperate + { + /// <summary> + /// 杩炴帴鍚敤寮�鍏� + /// </summary> + public bool Enabled { get; set; } + + /// <summary> + /// 杩炴帴ID + /// </summary> + public string ConnId { get; set; } + + /// <summary> + /// 浠庡簱鎵ц绾у埆锛岃秺澶ц秺鍏堟墽琛� + /// </summary> + public int HitRate { get; set; } + + /// <summary> + /// 杩炴帴瀛楃涓� + /// </summary> + public string Connection { get; set; } + + /// <summary> + /// 鏁版嵁搴撶被鍨� + /// </summary> + public DataBaseType DbType { get; set; } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/DB/MainDb.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/DB/MainDb.cs" new file mode 100644 index 0000000..41c56a5 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/DB/MainDb.cs" @@ -0,0 +1,29 @@ +锘縰sing SqlSugar; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WIDESEA_Core.DB +{ + public static class MainDb + { + public const string CurrentDbConnId = "WIDESEA"; + public const string ConnectionString = "ConnectionString"; + public const string ConnectionStringWCS = "ConnectionStringWCS"; + public const string TenantTableName = "Sys_Tenant"; + public const string TenantStatus = "Status"; + public const string TenantId = "TenantId"; + public const string TenantName = "TenantName"; + public const string EntityNameSpace = "WIDESEA_Model.Models"; + public const string TenantDbType = "DbType"; + public const string AssemblyName = "WIDESEA_Model.dll"; + public static DbType DbType = DbType.SqlServer; + public const string UserTableName = "Sys_User"; + public const string RoleId = "Role_Id"; + public const string SystemType = "SystemType"; + public const string UserName = "UserName"; + public const string UserId = "User_Id"; + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/DB/Models/BaseEntity.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/DB/Models/BaseEntity.cs" new file mode 100644 index 0000000..81bb1a4 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/DB/Models/BaseEntity.cs" @@ -0,0 +1,100 @@ +锘縰sing Magicodes.ExporterAndImporter.Core; +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WIDESEA_Core.DB.Models +{ + public class BaseEntity + { + #region 鏁版嵁鐘舵�佺鐞� + + /// <summary> + /// 鐘舵�� <br/> + /// 涓珛瀛楁锛屾煇浜涜〃鍙娇鐢ㄦ煇浜涜〃涓嶄娇鐢� + /// </summary> + //public bool Enabled { get; set; } = true; + + /// <summary> + /// 涓珛瀛楁锛屾煇浜涜〃鍙娇鐢ㄦ煇浜涜〃涓嶄娇鐢� <br/> + /// 閫昏緫涓婄殑鍒犻櫎锛岄潪鐗╃悊鍒犻櫎 <br/> + /// 渚嬪锛氬崟鎹垹闄ゅ苟闈炵洿鎺ュ垹闄� + /// </summary> + //public bool IsDeleted { get; set; } + + /// <summary> + /// 涓珛瀛楁 <br/> + /// 鏄惁鍐呯疆鏁版嵁 + /// </summary> + //public bool IsInternal { get; set; } + + #endregion 鏁版嵁鐘舵�佺鐞� + + #region 鍒涘缓 + + /// <summary> + /// 澶� 娉�:鍒涘缓鑰匢D + /// 榛樿鍊�: + ///</summary> + //[ImporterHeader(Name = "鍒涘缓鑰匢D")] + //[ExporterHeader(DisplayName = "鍒涘缓鑰匢D")] + //[SugarColumn(ColumnName = "CreateID", IsNullable = false, IsOnlyIgnoreUpdate = true, ColumnDescription = "鍒涘缓鑰匢D")] + //public int? CreateID { get; set; } + + /// <summary> + /// 鍒涘缓鑰� + /// </summary> + [ImporterHeader(Name = "鍒涘缓鑰�")] + [ExporterHeader(DisplayName = "鍒涘缓鑰�")] + [SugarColumn(IsNullable = false, IsOnlyIgnoreUpdate = true, ColumnDescription = "鍒涘缓鑰�")] + public string Creater { get; set; } = "Systeam"; + + /// <summary> + /// 鍒涘缓鏃堕棿 + /// </summary> + [ImporterHeader(Name = "鍒涘缓鏃堕棿")] + [ExporterHeader(DisplayName = "鍒涘缓鏃堕棿")] + [SugarColumn(IsNullable = false, IsOnlyIgnoreUpdate = true, ColumnDescription = "鍒涘缓鏃堕棿")] + public DateTime CreateDate { get; set; } = DateTime.Now; + + #endregion + + #region 淇敼 + + /// <summary> + /// 澶� 娉�:淇敼浜篒D + /// 榛樿鍊�: + ///</summary> + //[ImporterHeader(Name = "淇敼浜篒D")] + //[ExporterHeader(DisplayName = "淇敼浜篒D")] + //[SugarColumn(IsNullable = true, IsOnlyIgnoreInsert = true, ColumnName = "ModifyID", ColumnDescription = "淇敼浜篒D")] + //public int? ModifyID { get; set; } + + /// <summary> + /// 鏇存柊鑰� + /// </summary> + [ImporterHeader(Name = "淇敼浜�")] + [ExporterHeader(DisplayName = "淇敼浜�")] + [SugarColumn(IsNullable = true, IsOnlyIgnoreInsert = true, ColumnDescription = "淇敼浜�")] + public string Modifier { get; set; } + + /// <summary> + /// 淇敼鏃ユ湡 + /// </summary> + [ImporterHeader(Name = "淇敼鏃ユ湡")] + [ExporterHeader(DisplayName = "淇敼鏃ユ湡")] + [SugarColumn(IsNullable = true, IsOnlyIgnoreInsert = true, ColumnDescription = "淇敼鏃ユ湡")] + public DateTime? ModifyDate { get; set; } = DateTime.Now; + + /// <summary> + /// 鏁版嵁鐗堟湰 + /// </summary> + //[SugarColumn(DefaultValue = "0", IsEnableUpdateVersionValidation = true)] //鏍囪瘑鐗堟湰瀛楁 + //public long Version { get; set; } + + #endregion 淇敼 + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/DB/RepositorySetting.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/DB/RepositorySetting.cs" new file mode 100644 index 0000000..67c4968 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/DB/RepositorySetting.cs" @@ -0,0 +1,53 @@ +锘縰sing SqlSugar; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Core.DB.Models; +using WIDESEA_Core.Tenants; + +namespace WIDESEA_Core.DB +{ + public class RepositorySetting + { + private static readonly Lazy<IEnumerable<Type>> AllEntitys = new(() => + { + var path = AppDomain.CurrentDomain.RelativeSearchPath ?? AppDomain.CurrentDomain.BaseDirectory; + var referencedAssemblies = System.IO.Directory.GetFiles(path, MainDb.AssemblyName).Select(Assembly.LoadFrom).FirstOrDefault(); + return referencedAssemblies + .GetTypes() + .Where(t => t.IsClass && !t.IsAbstract && t.IsSubclassOf(typeof(BaseEntity))) + .Where(it => it.FullName != null && it.FullName.StartsWith(MainDb.EntityNameSpace)); + }); + + public static IEnumerable<Type> Entitys => AllEntitys.Value; + + /// <summary> + /// 閰嶇疆瀹炰綋杞垹闄よ繃婊ゅ櫒<br/> + /// 缁熶竴杩囨护 杞垹闄� 鏃犻渶鑷繁鍐欐潯浠� + /// </summary> + public static void SetDeletedEntityFilter(SqlSugarScopeProvider db) + { + //db.QueryFilter.AddTableFilter<IDeleteFilter>(it => it.IsDeleted == false); + } + + /// <summary> + /// 閰嶇疆绉熸埛 + /// </summary> + public static void SetTenantEntityFilter(SqlSugarScopeProvider db) + { + if (App.User is not { UserId: > 0, TenantId: > 0 }) + { + return; + } + + //澶氱鎴� 鍗曡〃 + //db.QueryFilter.AddTableFilter<ITenantEntity>(it => it.TenantId == App.User.TenantId || it.TenantId == 0); + + //澶氱鎴� 澶氳〃 + //db.SetTenantTable(App.User.TenantId.ToString()); + } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Enums/EnumHelper.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Enums/EnumHelper.cs" new file mode 100644 index 0000000..60cddd4 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Enums/EnumHelper.cs" @@ -0,0 +1,111 @@ +锘縰sing System.ComponentModel; +using System.Reflection; + +namespace WIDESEA_Core.Enums +{ + public static class EnumHelper + { + /// <summary> + /// 鏋氫妇杞瓧鍏搁泦鍚� + /// </summary> + /// <typeparam name="T">鏋氫妇绫诲悕绉�</typeparam> + /// <param name="keyDefault">榛樿key鍊�</param> + /// <param name="valueDefault">榛樿value鍊�</param> + /// <returns>杩斿洖鐢熸垚鐨勫瓧鍏搁泦鍚�</returns> + public static Dictionary<string, object> EnumListDic<T>(string keyDefault, string valueDefault = "") + { + Dictionary<string, object> dicEnum = new Dictionary<string, object>(); + Type enumType = typeof(T); + if (!enumType.IsEnum) + { + return dicEnum; + } + if (!string.IsNullOrEmpty(keyDefault)) //鍒ゆ柇鏄惁娣诲姞榛樿閫夐」 + { + dicEnum.Add(keyDefault, valueDefault); + } + string[] fieldstrs = Enum.GetNames(enumType); //鑾峰彇鏋氫妇瀛楁鏁扮粍 + foreach (var item in fieldstrs) + { + string description = string.Empty; + var field = enumType.GetField(item); + object[] arr = field.GetCustomAttributes(typeof(DescriptionAttribute), true); //鑾峰彇灞炴�у瓧娈垫暟缁� + if (arr != null && arr.Length > 0) + { + description = ((DescriptionAttribute)arr[0]).Description; //灞炴�ф弿杩� + } + else + { + description = item; //鎻忚堪涓嶅瓨鍦ㄥ彇瀛楁鍚嶇О + } + dicEnum.Add(description, (int)Enum.Parse(enumType, item)); //涓嶇敤鏋氫妇鐨剉alue鍊间綔涓哄瓧鍏竗ey鍊肩殑鍘熷洜浠庢灇涓句緥瀛愯兘鐪嬪嚭鏉ワ紝鍏跺疄杩欒竟搴旇鍒ゆ柇浠栫殑鍊间笉瀛樺湪锛岄粯璁ゅ彇瀛楁鍚嶇О + } + return dicEnum; + } + /// <summary> + /// 鑾峰彇鏋氫妇椤规弿杩颁俊鎭� 渚嬪GetEnumDesc(Days.Sunday) + /// </summary> + /// <param name="en">鏋氫妇椤� 濡侱ays.Sunday</param> + /// <returns></returns> + public static string GetIntegralRuleTypeEnumDesc(this Enum en) + { + Type type = en.GetType(); + MemberInfo[] memInfo = type.GetMember(en.ToString()); + if (memInfo != null && memInfo.Length > 0) + { + object[] attrs = memInfo[0].GetCustomAttributes(typeof(System.ComponentModel.DescriptionAttribute), false); + if (attrs != null && attrs.Length > 0) + return ((DescriptionAttribute)attrs[0]).Description; + } + return en.ToString(); + } + /// <summary> + /// 鑾峰彇鏋氫妇闆嗗悎 + /// </summary> + /// <typeparam name="T">鏋氫妇绫诲悕绉�</typeparam> + /// <returns></returns> + public static IEnumerable<EnumModel> GetEnumList<T>() + { + var model = default(T); + FieldInfo[] fieldinfo = typeof(T).GetFields(); + List<EnumModel> result = new List<EnumModel>(); + foreach (FieldInfo field in fieldinfo) + { + EnumModel enumModel = new EnumModel(); + if (!(Attribute.GetCustomAttribute(field, typeof(DescriptionAttribute)) is DescriptionAttribute attribute)) + { + enumModel.Desc = field.GetValue(model).ToString(); + } + else + { + enumModel.Desc = attribute.Description; + } + enumModel.Value = field.GetValue(model).GetHashCode(); + enumModel.Key = field.GetValue(model) as ValueType; + if (field.GetValue(model).ToString() != "0") + { + result.Add(enumModel); + } + + } + return result; + } + } + + public class EnumModel + { + /// <summary> + /// Enum鐨勫�� + /// </summary> + public int Value { get; set; } + /// <summary> + /// Enum鐨刱ey + /// </summary> + public ValueType Key { get; set; } + /// <summary> + /// Enum鎻忚堪 + /// </summary> + public string Desc { get; set; } + } + +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Enums/LinqExpressionType.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Enums/LinqExpressionType.cs" new file mode 100644 index 0000000..cd90b5a --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Enums/LinqExpressionType.cs" @@ -0,0 +1,21 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WIDESEA_Core.Enums +{ + public enum LinqExpressionType + { + Equal = 0,//= + NotEqual = 1,//!= + GreaterThan,//> + LessThan,//< + ThanOrEqual,//>= + LessThanOrEqual,//<= + In, + Contains,//Contains + NotContains//NotContains + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Enums/ManageEnum.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Enums/ManageEnum.cs" new file mode 100644 index 0000000..f085a5c --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Enums/ManageEnum.cs" @@ -0,0 +1,623 @@ +锘縰sing System.ComponentModel; + +namespace WIDESEA_Core.Enums +{ + /// <summary> + /// 鍚鐘舵�� + /// </summary> + public enum EnableEnum + { + /// <summary> + /// 鍏ㄩ儴 + /// </summary> + [Description("鍏ㄩ儴")] + All = -1, + + /// <summary> + /// 绂佺敤 + /// </summary> + [Description("绂佺敤")] + Disable = 0, + + /// <summary> + /// 鍚敤 + /// </summary> + [Description("鍚敤")] + Enable = 1, + } + + /// <summary> + /// 璐т綅鐘舵�� + /// </summary> + public enum LocationEnum + { + /// <summary> + /// 鍏ㄩ儴 + /// </summary> + [Description("鍏ㄩ儴")] + All = -1, + + /// <summary> + /// 绌洪棽 + /// </summary> + [Description("绌洪棽")] + Free = 0, + + /// <summary> + /// 閿佸畾 + /// </summary> + [Description("閿佸畾")] + Lock = 1, + + /// <summary> + /// 鏈夎揣 + /// </summary> + [Description("鏈夎揣")] + InStock = 2, + + /// <summary> + /// 鏈夎揣绂佺敤 + /// </summary> + [Description("鏈夎揣绂佺敤")] + InStockDisable = 3, + + /// <summary> + /// 鏃犺揣绂佺敤 + /// </summary> + [Description("鏃犺揣绂佺敤")] + FreeDisable = 4, + + /// <summary> + /// 棰勫垎閰� + /// </summary> + [Description("棰勫垎閰�")] + Distribute = 5, + } + + public enum LocationState + { + /// <summary> + /// 鍏佽 + /// </summary> + [Description("鍏佽")] + Allow = 1, + + /// <summary> + /// 涓嶅厑璁� + /// </summary> + [Description("涓嶅厑璁�")] + NotAllow = 2 + } + + public enum LocationType + { + /// <summary> + /// 鍗曟繁璐т綅 + /// </summary> + [Description("鍗曟繁璐т綅")] + Single = 1, + + /// <summary> + /// 鍙屾繁璐т綅 + /// </summary> + [Description("鍙屾繁璐т綅")] + Double = 2 + } + + #region 浠诲姟绫诲瀷 + + /// <summary> + /// 浠诲姟绫诲瀷 + /// </summary> + + public enum TaskInboundTypeEnum + { + /// <summary> + /// 鍏ュ簱 + /// </summary> + [Description("鍏ュ簱")] + Inbound = 200, + + /// <summary> + /// 鐩樼偣鍏ュ簱 + /// </summary> + [Description("鐩樼偣鍏ュ簱")] + InInventory = 201, + + /// <summary> + /// 鍒嗘嫞鍏ュ簱 + /// </summary> + [Description("鍒嗘嫞鍏ュ簱")] + InPick = 202, + + /// <summary> + /// 璐ㄦ鍏ュ簱 + /// </summary> + [Description("璐ㄦ鍏ュ簱")] + InQuality = 203, + + /// <summary> + /// 绌烘墭鐩樺叆搴� + /// </summary> + [Description("绌烘墭鐩樺叆搴�")] + InTray = 204, + + /// <summary> + /// NG鍏ュ簱 + /// </summary> + [Description("NG鍏ュ簱")] + InNG = 205, + + /// <summary> + /// 杞﹁疆鍏ュ簱 + /// </summary> + [Description("杞﹁疆鍏ュ簱")] + InWheels = 206, + + /// <summary> + /// 鍒跺姩鐩樺叆搴� + /// </summary> + [Description("鍒跺姩鐩樺叆搴�")] + InBrake = 207, + } + + public enum TaskOutboundTypeEnum + { + /// <summary> + /// 鍑哄簱 + /// </summary> + [Description("鍑哄簱")] + Outbound = 100, + + /// <summary> + /// 鐩樼偣鍑哄簱 + /// </summary> + [Description("鐩樼偣鍑哄簱")] + OutInventory = 101, + + /// <summary> + /// 鍒嗘嫞鍑哄簱 + /// </summary> + [Description("鍒嗘嫞鍑哄簱")] + OutPick = 102, + + /// <summary> + /// 璐ㄦ鍑哄簱 + /// </summary> + [Description("璐ㄦ鍑哄簱")] + OutQuality = 103, + + /// <summary> + /// 绌烘墭鐩樺嚭搴� + /// </summary> + [Description("绌烘墭鐩樺嚭搴�")] + OutTray = 104, + + /// <summary> + /// NG鍑哄簱 + /// </summary> + [Description("NG鍑哄簱")] + OutNG = 105, + + /// <summary> + /// 鐩存帴鍑哄簱 + /// </summary> + [Description("鐩存帴鍑哄簱")] + InToOut = 106, + + /// <summary> + /// 杞﹁疆鍑哄簱 + /// </summary> + [Description("杞﹁疆鍏ュ簱")] + OutWheels = 107, + + /// <summary> + /// 鍒跺姩鐩樺嚭搴� + /// </summary> + [Description("鍒跺姩鐩樺嚭搴�")] + OutBrake = 108, + } + + public enum TaskRelocationTypeEnum + { + /// <summary> + /// 搴撳唴绉诲簱 + /// </summary> + [Description("搴撳唴绉诲簱")] + Relocation = 300, + + /// <summary> + /// 搴撳绉诲簱 + /// </summary> + [Description("搴撳绉诲簱")] + RelocationIn = 301 + } + + public enum TaskOtherTypeEnum + { + } + + public enum TaskTypeEnum + { + /// <summary> + /// 鍑哄簱 =100 + /// </summary> + [Description("鍑哄簱")] + Outbound = 100, + + /// <summary> + /// 鐩樼偣鍑哄簱 + /// </summary> + [Description("鍑哄簱")] + OutInventory = 101, + + /// <summary> + /// 鍒嗘嫞鍑哄簱 + /// </summary> + [Description("鍑哄簱")] + OutPick = 102, + + /// <summary> + /// 璐ㄦ鍑哄簱 + /// </summary> + [Description("鍑哄簱")] + OutQuality = 103, + + /// <summary> + /// 鍏ュ簱 + /// </summary> + [Description("鍑哄簱")] + Inbound = 200, + + /// <summary> + /// 鐩樼偣鍏ュ簱 + /// </summary> + InInventory = 201, + + /// <summary> + /// 鍒嗘嫞鍏ュ簱 + /// </summary> + InPick = 202, + + /// <summary> + /// 璐ㄦ鍏ュ簱 + /// </summary> + InQuality = 203, + + /// <summary> + /// 绉诲簱 + /// </summary> + Relocation = 300, + + /// <summary> + /// 搴撳唴绉诲簱 + /// </summary> + RelocationIn = 301, + + /// <summary> + /// 搴撳绉诲簱 + /// </summary> + RelocationOut = 302 + } + + #endregion 浠诲姟绫诲瀷 + + #region 鍏ュ簱浠诲姟鐘舵�� + + /// <summary> + /// 鍏ュ簱浠诲姟鐘舵�� 200 鏂板缓鍏ュ簱浠诲姟 锛� 210 AGV鍏ュ簱鎵ц涓紝 215 AGV鍏ュ簱瀹屾垚锛� 220杈撻�佺嚎鍏ュ簱鎵ц涓紝 225 杈撻�佺嚎鍏ュ簱瀹屾垚锛� 230 鍫嗗灈鏈哄叆搴撴墽琛屼腑锛� 235 鍫嗗灈鏈哄叆搴撳畬鎴愶紝290 鍏ュ簱浠诲姟鍙栨秷锛�298 鍏ュ簱浠诲姟瀹屾垚锛�299 鍏ュ簱浠诲姟寮傚父,300 鏂板缓绉诲簱搴撲换鍔� + /// </summary> + public enum TaskInStatusEnum + { + /// <summary> + /// 鏂板缓鍏ュ簱浠诲姟 + /// </summary> + [Description("鏂板缓鍏ュ簱浠诲姟")] + InNew = 200, + + ///// <summary> + ///// AGV鍏ュ簱鎵ц涓� + ///// </summary> + //[Description("AGV鍏ュ簱鎵ц涓�")] + //AGV_InExecuting = 210, + + ///// <summary> + ///// AGV鍏ュ簱瀹屾垚 + ///// </summary> + //[Description("AGV鎼繍瀹屾垚")] + //AGV_InFinish = 215, + + /// <summary> + /// 杈撻�佺嚎鍏ュ簱鎵ц涓� + /// </summary> + [Description("杈撻�佺嚎鍏ュ簱鎵ц涓�")] + Line_InExecuting = 220, + + /// <summary> + /// 杈撻�佺嚎鍏ュ簱瀹屾垚 + /// </summary> + [Description("杈撻�佺嚎杈撻�佸畬鎴�")] + Line_InFinish = 225, + + /// <summary> + /// 鍫嗗灈鏈哄叆搴撴墽琛屼腑 + /// </summary> + [Description("鍫嗗灈鏈哄叆搴撴墽琛屼腑")] + SC_InExecuting = 230, + + /// <summary> + /// 鍫嗗灈鏈哄叆搴撳畬鎴� + /// </summary> + [Description("鍫嗗灈鏈哄叆搴撳畬鎴�")] + SC_InFinish = 235, + + /// <summary> + /// 鍏ュ簱浠诲姟瀹屾垚 + /// </summary> + [Description("鍏ュ簱浠诲姟瀹屾垚")] + InFinish = 290, + + /// <summary> + /// 鍏ュ簱浠诲姟鎸傝捣 + /// </summary> + [Description("鍏ュ簱浠诲姟鎸傝捣")] + InPending = 297, + + /// <summary> + /// 鍏ュ簱浠诲姟鍙栨秷 + /// </summary> + [Description("鍏ュ簱浠诲姟鍙栨秷")] + InCancel = 298, + + /// <summary> + /// 鍏ュ簱浠诲姟寮傚父 + /// </summary> + [Description("鍏ュ簱浠诲姟寮傚父")] + InException = 299, + } + + #endregion 鍏ュ簱浠诲姟鐘舵�� + + /// <summary> + /// 鍑哄簱浠诲姟鐘舵�� 100 鏂板缓鍑哄簱浠诲姟锛� 110 AGV鍑哄簱鎵ц涓紝 115 AGV鍑哄簱瀹屾垚锛� 120杈撻�佺嚎鍑哄簱鎵ц涓紝 125 杈撻�佺嚎鍑哄簱瀹屾垚锛� 130 鍫嗗灈鏈哄嚭搴撴墽琛屼腑锛� 135 鍫嗗灈鏈哄嚭搴撳畬鎴愶紝190 鍑哄簱浠诲姟鍙栨秷锛�198 鍑哄簱浠诲姟瀹屾垚锛�199 鍑哄簱浠诲姟寮傚父 + /// </summary> + public enum TaskOutStatusEnum + { + /// <summary> + /// 鏂板缓鍑哄簱浠诲姟 + /// </summary> + [Description("鏂板缓鍑哄簱浠诲姟")] + OutNew = 100, + + /// <summary> + /// 鍫嗗灈鏈哄嚭搴撴墽琛屼腑 + /// </summary> + [Description("鍫嗗灈鏈哄嚭搴撴墽琛屼腑")] + SC_OutExecuting = 110, + + /// <summary> + /// 鍫嗗灈鏈哄嚭搴撳畬鎴� + /// </summary> + [Description("鍫嗗灈鏈哄嚭搴撳畬鎴�")] + SC_OutFinish = 115, + + /// <summary> + /// 杈撻�佺嚎鍑哄簱鎵ц涓� + /// </summary> + [Description("杈撻�佺嚎鍑哄簱鎵ц涓�")] + Line_OutExecuting = 120, + + /// <summary> + /// 杈撻�佺嚎鍑哄簱瀹屾垚 + /// </summary> + [Description("杈撻�佺嚎杈撻�佸畬鎴�")] + Line_OutFinish = 125, + + + + ///// <summary> + ///// AGV鍑哄簱鎵ц涓� + ///// </summary> + //[Description("AGV鍑哄簱鎵ц涓�")] + //AGV_OutExecuting = 130, + + ///// <summary> + ///// AGV鍑哄簱瀹屾垚 + ///// </summary> + //[Description("AGV鎼繍瀹屾垚")] + //AGV_OutFinish = 135, + + /// <summary> + /// 璁惧娴嬮噺涓� + /// </summary> + [Description("璁惧娴嬮噺涓�")] + Lien_Check = 150, + + /// <summary> + /// 璁惧娴嬮噺瀹屾垚 + /// </summary> + [Description("璁惧娴嬮噺瀹屾垚")] + Lien_CheckFinish = 155, + + /// <summary> + /// 鍑哄簱浠诲姟瀹屾垚 + /// </summary> + [Description("鍑哄簱浠诲姟瀹屾垚")] + OutFinish = 190, + + /// <summary> + /// 鍑哄簱浠诲姟鎸傝捣 + /// </summary> + [Description("鍑哄簱浠诲姟鎸傝捣")] + OutPending = 197, + + /// <summary> + /// 鍑哄簱浠诲姟鍙栨秷 + /// </summary> + [Description("鍑哄簱浠诲姟鍙栨秷")] + OutCancel = 198, + + /// <summary> + /// 鍑哄簱浠诲姟寮傚父 + /// </summary> + [Description("鍑哄簱浠诲姟寮傚父")] + OutException = 199, + } + + /// <summary> + /// 鍏ュ簱鍗曠被鍨� 100 鐢熶骇鍏ュ簱鍗�;200 鐢熶骇閫�鏂欏崟;300 閲囪喘鍏ュ簱鍗�;400 璋冩嫧鍏ュ簱鍗�;500 閿�鍞��璐у崟;600 绌虹洏鍏ュ簱鍗�;700 鍏朵粬鍏ュ簱鍗� + /// </summary> + public enum InOrderTypeEnum + { + /// <summary> + /// 鐢熶骇鍏ュ簱鍗� + /// </summary> + Product = 100, + + /// <summary> + /// 鐢熶骇閫�鏂欏崟 + /// </summary> + Return = 200, + + /// <summary> + /// 閲囪喘鍏ュ簱鍗� + /// </summary> + Purchase = 300, + + /// <summary> + /// 璋冩嫧鍏ュ簱鍗� + /// </summary> + Allocat = 400, + + /// <summary> + /// 閿�鍞��璐у崟 + /// </summary> + SaleReturn = 500, + + /// <summary> + /// 绌虹洏鍏ュ簱鍗� + /// </summary> + EmptyDisk = 600, + + /// <summary> + /// 鍏朵粬鍏ュ簱鍗� + /// </summary> + Other = 700 + } + + /// <summary> + /// 鍑哄簱鍗曠被鍨� + /// </summary> + public enum OutOrderTypeEnum + { + /// <summary> + /// 鐢熶骇杩斿伐鍗� + /// </summary> + Rework = 100, + + /// <summary> + /// 鐢熶骇鍙戞枡鍗� + /// </summary> + Issue = 200, + + /// <summary> + /// 閲囪喘閫�璐у崟 + /// </summary> + ProcureReturn = 300, + + /// <summary> + /// 璋冩嫧鍑哄簱鍗� + /// </summary> + Allocate = 400, + + /// <summary> + /// 閿�鍞嚭搴撳崟 + /// </summary> + SaleOut = 500, + + /// <summary> + /// 绌虹洏鍑哄簱鍗� + /// </summary> + EmptyDisk = 600, + + /// <summary> + /// 璐ㄦ鍑哄簱鍗� + /// </summary> + Quality = 700, + + /// <summary> + /// 鍏朵粬鍑哄簱鍗� + /// </summary> + Other = 800 + } + + #region 鍘熷鍗曟嵁鍚屾鐘舵�� + + /// <summary> + /// 鍚屾鏍囧織 0:鏈悓姝� 1锛氬悓姝ユ垚鍔� 2锛氬悓姝ュけ璐� + /// </summary> + public enum SynchronizationFlagEmun + { + 鏈悓姝� = 0, + 鍚屾鎴愬姛 = 1, + 鍚屾澶辫触 = 2 + } + + #endregion 鍘熷鍗曟嵁鍚屾鐘舵�� + + #region 鍏ュ簱鍗曟嵁鐘舵�� + + /// <summary> + /// 鍏ュ簱鍗曟嵁鐘舵�� 0锛屾湭寮�濮� 1锛屽叆搴撲腑 2锛屽叆搴撳畬鎴� + /// </summary> + public enum InboundStateEmun + { + 鏈紑濮� = 0, + 鍏ュ簱涓� = 1, + 鍏ュ簱瀹屾垚 = 2 + } + + #endregion 鍏ュ簱鍗曟嵁鐘舵�� + + #region 缁勭洏绫诲瀷 + + /// <summary> + /// 缁勭洏绫诲瀷 1锛氫竴娆$粍鐩� 2锛氬娆$粍鐩� + /// </summary> + public enum GroupTypeEmun + { + 涓�娆$粍鐩� = 1, + 澶氭缁勭洏 = 2 + } + + #endregion 缁勭洏绫诲瀷 + + #region 搴撳瓨鐘舵�� + + /// <summary> + /// 搴撳瓨鐘舵�侊細 1锛岀粍鐩樻殏瀛� 2锛岀粍鐩樻挙閿� 3锛屽叆搴撶‘璁� 4锛屽叆搴撴挙閿� 5锛屽凡鍏ュ簱 6锛屽凡鍑哄簱 + /// </summary> + public enum StockStateEmun + { + 缁勭洏鏆傚瓨 = 1, + 缁勭洏鎾ら攢 = 2, + 鍏ュ簱纭 = 3, + 鍏ュ簱鎾ら攢 = 4, + 宸插叆搴� = 5, + 鍏ュ簱瀹屾垚 = 6, + 鍑哄簱閿佸畾 = 7, + 鍑哄簱瀹屾垚 = 8, + } + + #endregion 搴撳瓨鐘舵�� + + public enum OperateTypeEnum + { + 浜哄伐鍒犻櫎 = 1, + 鑷姩鍒犻櫎 = 2, + 浜哄伐鎭㈠ = 3, + 鑷姩鎭㈠ = 4, + 浜哄伐瀹屾垚 = 5, + 鑷姩瀹屾垚 = 6, + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Extensions/AllOptionRegister.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Extensions/AllOptionRegister.cs" new file mode 100644 index 0000000..93eefc0 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Extensions/AllOptionRegister.cs" @@ -0,0 +1,24 @@ +锘縰sing Microsoft.Extensions.DependencyInjection; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Core.Core; + +namespace WIDESEA_Core.Extensions +{ + public static class AllOptionRegister + { + public static void AddAllOptionRegister(this IServiceCollection services) + { + if (services == null) throw new ArgumentNullException(nameof(services)); + + foreach (var optionType in App.EffectiveTypes.Where(s => + !s.IsInterface && typeof(IConfigurableOptions).IsAssignableFrom(s))) + { + services.AddConfigurableOptions(optionType); + } + } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Extensions/ApplicationSetup.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Extensions/ApplicationSetup.cs" new file mode 100644 index 0000000..404bf07 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Extensions/ApplicationSetup.cs" @@ -0,0 +1,28 @@ +锘縰sing Microsoft.AspNetCore.Builder; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WIDESEA_Core.Extensions +{ + public static class ApplicationSetup + { + public static void UseApplicationSetup(this WebApplication app) + { + app.Lifetime.ApplicationStarted.Register(() => + { + App.IsRun = true; + }); + + app.Lifetime.ApplicationStopped.Register(() => + { + App.IsRun = false; + + //娓呴櫎鏃ュ織 + //Log.CloseAndFlush(); + }); + } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Extensions/AutofacModuleRegister.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Extensions/AutofacModuleRegister.cs" new file mode 100644 index 0000000..4bd22d5 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Extensions/AutofacModuleRegister.cs" @@ -0,0 +1,78 @@ +锘縰sing Autofac; +using Autofac.Extras.DynamicProxy; +using log4net; +using Microsoft.Extensions.DependencyModel; +using OfficeOpenXml.FormulaParsing.Excel.Functions.Text; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using System.Runtime.Loader; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Core.AOP; +using WIDESEA_Core.BaseRepository; +using WIDESEA_Core.BaseServices; +using WIDESEA_Core.Helper; + +namespace WIDESEA_Core.Extensions +{ + public class AutofacModuleRegister : Autofac.Module + { + //private static readonly ILog log = LogManager.GetLogger(typeof(AutofacModuleRegister)); + protected override void Load(ContainerBuilder builder) + { + var cacheType = new List<Type>(); + + builder.RegisterType<LogAOP>(); + cacheType.Add(typeof(LogAOP)); + + builder.RegisterGeneric(typeof(RepositoryBase<>)).As(typeof(IRepository<>)).InstancePerDependency();//娉ㄥ唽浠撳偍 + builder.RegisterGeneric(typeof(ServiceBase<,>)).As(typeof(IService<>)).InstancePerDependency();//娉ㄥ唽鏈嶅姟 + + Type baseType = typeof(IDependency); + + List<RuntimeLibrary> compilationLibrary = DependencyContext.Default + .RuntimeLibraries + .Where(x => !x.Serviceable && x.Type == "project") + .ToList(); + + List<Assembly> assemblyList = new List<Assembly>(); + foreach (var library in compilationLibrary) + { + try + { + assemblyList.Add(AssemblyLoadContext.Default.LoadFromAssemblyName(new AssemblyName(library.Name))); + } + catch (Exception ex) + { + Console.WriteLine(library.Name + ex.Message); + } + } + + builder.RegisterAssemblyTypes(assemblyList.ToArray()).Where(x => !x.IsInterface && !x.IsAbstract && baseType.IsAssignableFrom(x)) + .AsImplementedInterfaces() + .PropertiesAutowired() + .InstancePerDependency() + .EnableInterfaceInterceptors() + .InterceptedBy(cacheType.ToArray()); + + + //foreach (var assembly in assemblyList) + //{ + // foreach (var type in assembly.GetTypes()) + // { + // if (!type.IsInterface && !type.IsAbstract && baseType.IsAssignableFrom(type)) + // { + // Console.WriteLine($"娉ㄥ唽绫诲瀷: {type.FullName}"); + // } + // } + //} + + builder.RegisterType<UnitOfWorkManage>().As<IUnitOfWorkManage>() + .AsImplementedInterfaces() + .InstancePerLifetimeScope() + .PropertiesAutowired(); + } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Extensions/CorsSetup.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Extensions/CorsSetup.cs" new file mode 100644 index 0000000..e449a0e --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Extensions/CorsSetup.cs" @@ -0,0 +1,56 @@ +锘縰sing Microsoft.Extensions.DependencyInjection; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Core.Helper; + +namespace WIDESEA_Core.Extensions +{ + /// <summary> + /// Cors 璺ㄥ煙 + /// </summary> + public static class CorsSetup + { + /// <summary> + /// 璺ㄥ煙 + /// </summary> + /// <param name="services"></param> + /// <exception cref="ArgumentNullException"></exception> + public static void AddCorsSetup(this IServiceCollection services) + { + if (services == null) throw new ArgumentNullException(nameof(services)); + + services.AddCors(c => + { + if (!AppSettings.app(new string[] { "Cors", "EnableAllIPs" }).ObjToBool()) + { + c.AddPolicy(AppSettings.app(new string[] {"Cors", "PolicyName" }), + + policy => + { + policy + .WithOrigins(AppSettings.app(new string[] { "Cors", "IPs" }).Split(',')) + .AllowAnyHeader()//Ensures that the policy allows any header. + .AllowAnyMethod(); + }); + } + else + { + //鍏佽浠绘剰璺ㄥ煙璇锋眰 + c.AddPolicy(AppSettings.app(new string[] { "Cors", "PolicyName" }), + policy => + { + policy + .SetIsOriginAllowed((host) => true) + .AllowAnyMethod() + .AllowAnyHeader() + .AllowCredentials(); + }); + } + + }); + } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Extensions/DbSetup.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Extensions/DbSetup.cs" new file mode 100644 index 0000000..dba095c --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Extensions/DbSetup.cs" @@ -0,0 +1,24 @@ +锘縰sing Microsoft.Extensions.DependencyInjection; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Core.Seed; + +namespace WIDESEA_Core +{ + /// <summary> + /// Db 鍚姩鏈嶅姟 + /// </summary> + public static class DbSetup + { + public static void AddDbSetup(this IServiceCollection services) + { + if (services == null) throw new ArgumentNullException(nameof(services)); + + services.AddScoped<DBSeed>(); + services.AddScoped<DBContext>(); + } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Extensions/HttpContextSetup.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Extensions/HttpContextSetup.cs" new file mode 100644 index 0000000..2615700 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Extensions/HttpContextSetup.cs" @@ -0,0 +1,30 @@ +锘縰sing Microsoft.AspNetCore.Http; +using Microsoft.Extensions.DependencyInjection; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Core.HttpContextUser; + +namespace WIDESEA_Core.Extensions +{ + /// <summary> + /// HttpContext 鐩稿叧鏈嶅姟 + /// </summary> + public static class HttpContextSetup + { + /// <summary> + /// HttpContext 鐩稿叧鏈嶅姟 + /// </summary> + /// <param name="services"></param> + /// <exception cref="ArgumentNullException"></exception> + public static void AddHttpContextSetup(this IServiceCollection services) + { + if (services == null) throw new ArgumentNullException(nameof(services)); + + services.AddSingleton<IHttpContextAccessor, HttpContextAccessor>(); + services.AddScoped<IUser, AspNetUser>(); + } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Extensions/InitializationHostServiceSetup.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Extensions/InitializationHostServiceSetup.cs" new file mode 100644 index 0000000..9acbd1e --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Extensions/InitializationHostServiceSetup.cs" @@ -0,0 +1,28 @@ +锘縰sing Microsoft.Extensions.DependencyInjection; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WIDESEA_Core.Extensions +{ + public static class InitializationHostServiceSetup + { + /// <summary> + /// 搴旂敤鍒濆鍖栨湇鍔℃敞鍏� + /// </summary> + /// <param name="services"></param> + public static void AddInitializationHostServiceSetup(this IServiceCollection services) + { + if (services is null) + { + ArgumentNullException.ThrowIfNull(nameof(services)); + } + services.AddHostedService<SeedDataHostedService>();//绉嶅瓙鏁版嵁 + //services.AddHostedService<QuartzJobHostedService>(); + //services.AddHostedService<ConsulHostedService>(); + //services.AddHostedService<EventBusHostedService>(); + } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Extensions/IpPolicyRateLimitSetup.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Extensions/IpPolicyRateLimitSetup.cs" new file mode 100644 index 0000000..9684dfa --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Extensions/IpPolicyRateLimitSetup.cs" @@ -0,0 +1,43 @@ +锘縰sing Microsoft.AspNetCore.Http; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WIDESEA_Core.Extensions +{ + /// <summary> + /// IPLimit闄愭祦 鍚姩鏈嶅姟 + /// </summary> + public static class IpPolicyRateLimitSetup + { + public static void AddIpPolicyRateLimitSetup(this IServiceCollection services, IConfiguration Configuration) + { + if (services == null) throw new ArgumentNullException(nameof(services)); + + // needed to store rate limit counters and ip rules + //services.AddMemoryCache(); + + //load general configuration from appsettings.json + //services.Configure<IpRateLimitOptions>(Configuration.GetSection("IpRateLimiting")); + + // inject counter and rules stores + //services.AddSingleton<IIpPolicyStore, MemoryCacheIpPolicyStore>(); + //services.AddSingleton<IRateLimitCounterStore, MemoryCacheRateLimitCounterStore>(); + //services.AddSingleton<IProcessingStrategy, AsyncKeyLockProcessingStrategy>(); + + // inject counter and rules distributed cache stores + //services.AddSingleton<IIpPolicyStore, DistributedCacheIpPolicyStore>(); + //services.AddSingleton<IRateLimitCounterStore, DistributedCacheRateLimitCounterStore>(); + + // the clientId/clientIp resolvers use it. + //services.AddSingleton<IHttpContextAccessor, HttpContextAccessor>(); + + // configuration (resolvers, counter key builders) + //services.AddSingleton<IRateLimitConfiguration, RateLimitConfiguration>(); + } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Extensions/JobSetup.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Extensions/JobSetup.cs" new file mode 100644 index 0000000..1851aa6 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Extensions/JobSetup.cs" @@ -0,0 +1,23 @@ +锘縰sing Microsoft.Extensions.DependencyInjection; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using System.Text; +using System.Threading.Tasks; + +namespace WIDESEA_Core.Extensions +{ + + /// <summary> + /// 浠诲姟璋冨害 鍚姩鏈嶅姟 + /// </summary> + public static class JobSetup + { + public static void AddJobSetup(this IServiceCollection services) + { + if (services == null) throw new ArgumentNullException(nameof(services)); + + } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Extensions/MemoryCacheSetup.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Extensions/MemoryCacheSetup.cs" new file mode 100644 index 0000000..4d3a5ab --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Extensions/MemoryCacheSetup.cs" @@ -0,0 +1,27 @@ +锘縰sing Microsoft.Extensions.Caching.Memory; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Options; +using System; +using WIDESEA_Core.Caches; + +namespace WIDESEA_Core.Extensions +{ + /// <summary> + /// Memory缂撳瓨 鍚姩鏈嶅姟 + /// </summary> + public static class MemoryCacheSetup + { + public static void AddMemoryCacheSetup(this IServiceCollection services) + { + if (services == null) throw new ArgumentNullException(nameof(services)); + + services.AddScoped<ICaching, Caching>(); + services.AddSingleton<IMemoryCache>(factory => + { + var value = factory.GetRequiredService<IOptions<MemoryCacheOptions>>(); + var cache = new MemoryCache(value); + return cache; + }); + } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Extensions/MiniProfilerSetup.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Extensions/MiniProfilerSetup.cs" new file mode 100644 index 0000000..3ceecb8 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Extensions/MiniProfilerSetup.cs" @@ -0,0 +1,32 @@ +锘縰sing Microsoft.Extensions.DependencyInjection; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Core.Helper; + +namespace WIDESEA_Core.Extensions +{ + /// <summary> + /// MiniProfiler 鎬ц兘鍒嗘瀽 + /// </summary> + public static class MiniProfilerSetup + { + /// <summary> + /// 鎬ц兘鍒嗘瀽 + /// </summary> + /// <param name="services"></param> + /// <exception cref="ArgumentNullException"></exception> + public static void AddMiniProfilerSetup(this IServiceCollection services) + { + if (services == null) throw new ArgumentNullException(nameof(services)); + //if (AppSettings.app(new string[] { "Startup", "MiniProfiler", "Enabled" }).ObjToBool()) + //{ + services.AddMiniProfiler(options => + { + options.RouteBasePath = "/profiler"; + }); + } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Extensions/SqlsugarSetup.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Extensions/SqlsugarSetup.cs" new file mode 100644 index 0000000..364bbff --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Extensions/SqlsugarSetup.cs" @@ -0,0 +1,143 @@ +锘縰sing Microsoft.Extensions.Caching.Memory; +using Microsoft.Extensions.DependencyInjection; +using SqlSugar; +using StackExchange.Profiling; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Core.AOP; +using WIDESEA_Core.DB; +using WIDESEA_Core.Helper; +using WIDESEA_Core.LogHelper; +using WIDESEA_Core.Seed; + +namespace WIDESEA_Core +{ + /// <summary> + /// SqlSugar 鍚姩鏈嶅姟 + /// </summary> + public static class SqlsugarSetup + { + private static readonly MemoryCache Cache = new MemoryCache(new MemoryCacheOptions()); + + public static void AddSqlsugarSetup(this IServiceCollection services) + { + if (services == null) throw new ArgumentNullException(nameof(services)); + + // 榛樿娣诲姞涓绘暟鎹簱杩炴帴 + //MainDb.CurrentDbConnId = AppSettings.app(new string[] { "MainDB" }); + + // SqlSugarScope鏄嚎绋嬪畨鍏紝鍙娇鐢ㄥ崟渚嬫敞鍏� + // 鍙傝�冿細https://www.donet5.com/Home/Doc?typeId=1181 + services.AddScoped<ISqlSugarClient>(o => + { + var memoryCache = o.GetRequiredService<IMemoryCache>(); + + // 杩炴帴瀛楃涓� + var listConfig = new List<ConnectionConfig> + { + new ConnectionConfig + { + ConfigId = MainDb.CurrentDbConnId, + ConnectionString = DBContext.GetMainConnectionDb().Connection, + IsAutoCloseConnection = true, + DbType = MainDb.DbType, + AopEvents = new AopEvents + { + OnLogExecuting = (sql, p) => + { + Parallel.For(0, 1, e => + { + MiniProfiler.Current.CustomTiming("SQL锛�", GetParas(p) + "銆怱QL璇彞銆戯細" + sql); + }); + } + } + } + }; + #region 浠庡簱 + //var listConfig_Slave = new List<SlaveConnectionConfig>(); + //BaseDBConfig.MutiConnectionString.ForEach(s => + //{ + // if(s.ConnId != MainDb.CurrentDbConnId) + // { + // listConfig_Slave.Add(new SlaveConnectionConfig() + // { + // HitRate = s.HitRate, + // ConnectionString = s.Connection + // }); + // } + + //}); + + //BaseDBConfig.MutiConnectionString.ForEach(m => + //{ + // listConfig.Add(new ConnectionConfig() + // { + // ConfigId = m.ConnId.ObjToString().ToLower(), + // ConnectionString = m.Connection, + // DbType = (DbType)m.DbType, + // IsAutoCloseConnection = true, + // MoreSettings = new ConnMoreSettings() + // { + // //IsWithNoLockQuery = true, + // IsAutoRemoveDataCache = true + // }, + // // 浠庡簱 + // //SlaveConnectionConfigs = listConfig_Slave, + // // 鑷畾涔夌壒鎬� + // ConfigureExternalServices = new ConfigureExternalServices() + // { + // DataInfoCacheService = new SqlSugarMemoryCacheService(memoryCache), + // EntityService = (property, column) => + // { + // if (column.IsPrimarykey && property.PropertyType == typeof(int)) + // { + // column.IsIdentity = true; + // } + // } + // }, + // InitKeyType = InitKeyType.Attribute, + // AopEvents = new AopEvents() + // { + // OnError = x => + // { + // Console.WriteLine(x.Sql); + // } + // } + // } + // ); + //}); + #endregion + + SqlSugarClient sqlSugarClient = new SqlSugarClient(listConfig, db => + { + db.Aop.DataExecuting = SqlSugarAop.DataExecuting; + }); + return sqlSugarClient; + }); + } + + private static string GetWholeSql(SugarParameter[] paramArr, string sql) + { + foreach (var param in paramArr) + { + sql.Replace(param.ParameterName, param.Value.ObjToString()); + } + + return sql; + } + + private static string GetParas(SugarParameter[] pars) + { + string key = "銆怱QL鍙傛暟銆戯細"; + foreach (var param in pars) + { + key += $"{param.ParameterName}:{param.Value}\n"; + } + + return key; + } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Extensions/SwaggerSetup.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Extensions/SwaggerSetup.cs" new file mode 100644 index 0000000..b0f70df --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Extensions/SwaggerSetup.cs" @@ -0,0 +1,134 @@ +锘縰sing log4net; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.OpenApi.Models; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Core.Helper; +using static WIDESEA_Core.Extensions.CustomApiVersion; +using Swashbuckle.AspNetCore.Filters; + +namespace WIDESEA_Core.Extensions +{ + /// <summary> + /// Swagger + /// </summary> + public static class SwaggerSetup + { + + private static readonly ILog log = + LogManager.GetLogger(typeof(SwaggerSetup)); + /// <summary> + /// Swagger + /// </summary> + /// <param name="services"></param> + /// <exception cref="ArgumentNullException"></exception> + public static void AddSwaggerSetup(this IServiceCollection services) + { + if (services == null) throw new ArgumentNullException(nameof(services)); + + var basePath = AppContext.BaseDirectory; + //var basePath2 = Microsoft.DotNet.PlatformAbstractions.ApplicationEnvironment.ApplicationBasePath; + var ApiName = AppSettings.app(new string[] { "ApiName" }); + + services.AddSwaggerGen(c => + { + //閬嶅巻鍑哄叏閮ㄧ殑鐗堟湰锛屽仛鏂囨。淇℃伅灞曠ず + typeof(ApiVersions).GetEnumNames().ToList().ForEach(version => + { + c.SwaggerDoc(version, new OpenApiInfo + { + Version = version, + Title = $"{ApiName} 鎺ュ彛鏂囨。鈥斺�攞RuntimeInformation.FrameworkDescription}", + Description = $"{ApiName} HTTP API " + version, + //Contact = new OpenApiContact { Name = ApiName, Email = "Blog.Core@xxx.com", Url = new Uri("https://neters.club") }, + //License = new OpenApiLicense { Name = ApiName + " 瀹樻柟鏂囨。", Url = new Uri("http://apk.neters.club/.doc/") } + }); + //c.OrderActionsBy(o => o.RelativePath); + }); + + c.UseInlineDefinitionsForEnums(); + try + { + //杩欎釜灏辨槸鍒氬垰閰嶇疆鐨剎ml鏂囦欢鍚� + //var xmlPath = Path.Combine(basePath, "Blog.Core.xml"); + //榛樿鐨勭浜屼釜鍙傛暟鏄痜alse锛岃繖涓槸controller鐨勬敞閲婏紝璁板緱淇敼 + //c.IncludeXmlComments(xmlPath, true); + + //杩欎釜灏辨槸Model灞傜殑xml鏂囦欢鍚� + //var xmlModelPath = Path.Combine(basePath, "Blog.Core.Model.xml"); + //c.IncludeXmlComments(xmlModelPath); + } + catch (Exception ex) + { + log.Error("Blog.Core.xml鍜孊log.Core.Model.xml 涓㈠け锛岃妫�鏌ュ苟鎷疯礉銆俓n" + ex.Message); + } + + // 寮�鍚姞鏉冨皬閿� + c.OperationFilter<AddResponseHeadersFilter>(); + c.OperationFilter<AppendAuthorizeToSummaryOperationFilter>(); + + // 鍦╤eader涓坊鍔爐oken锛屼紶閫掑埌鍚庡彴 + //c.OperationFilter<SecurityRequirementsOperationFilter>(); + + c.AddSecurityDefinition("Bearer", new OpenApiSecurityScheme + { + Description = "JWT鎺堟潈token鍓嶉潰闇�瑕佸姞涓婂瓧娈礏earer涓庝竴涓┖鏍�,濡侭earer token", + Name = "Authorization", + In = ParameterLocation.Header, + Type = SecuritySchemeType.ApiKey, + BearerFormat = "JWT", + Scheme = "Bearer" + }); + + c.AddSecurityRequirement(new OpenApiSecurityRequirement + { + { + new OpenApiSecurityScheme + { + Reference = new OpenApiReference { + Type = ReferenceType.SecurityScheme, + Id = "Bearer" + } + }, + new string[] { } + } + }); + }).AddControllers() + .ConfigureApiBehaviorOptions(options => + { + options.SuppressConsumesConstraintForFormFileParameters = true; + options.SuppressInferBindingSourcesForParameters = true; + options.SuppressModelStateInvalidFilter = true; + options.SuppressMapClientErrors = true; + options.ClientErrorMapping[404].Link = + "https://*/404"; + }); + //services.AddSwaggerGenNewtonsoftSupport(); + } + } + + /// <summary> + /// 鑷畾涔夌増鏈� + /// </summary> + public class CustomApiVersion + { + /// <summary> + /// Api鎺ュ彛鐗堟湰 鑷畾涔� + /// </summary> + public enum ApiVersions + { + /// <summary> + /// V1 鐗堟湰 + /// </summary> + V1 = 1, + /// <summary> + /// V2 鐗堟湰 + /// </summary> + V2 = 2, + } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Filter/ApiAuthorizeFilter.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Filter/ApiAuthorizeFilter.cs" new file mode 100644 index 0000000..ce595c8 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Filter/ApiAuthorizeFilter.cs" @@ -0,0 +1,80 @@ +锘縰sing Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc.Filters; +using Microsoft.Extensions.Hosting; +using System; +using System.Collections.Generic; +using System.IdentityModel.Tokens.Jwt; +using System.Linq; +using System.Runtime; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Core.Authorization; +using WIDESEA_Core.Const; +using WIDESEA_Core.Helper; + +namespace WIDESEA_Core.Filter +{ + /// <summary> + /// 鍒ゆ柇token鏄惁姝g‘ + /// </summary> + public class ApiAuthorizeFilter : IAuthorizationFilter + { + private static readonly string replaceTokenPath = "/api/Sys_User/replaceToken"; + private static readonly string loginPath = "/api/Sys_User/login"; + private static readonly string vierificationCodePath = "/api/Sys_User/getVierificationCode"; + + public ApiAuthorizeFilter() + { + + } + + /// <summary> + /// 鍙垽鏂璽oken鏄惁姝g‘锛屼笉鍒ゆ柇鏉冮檺 + /// 濡傛灉闇�瑕佸垽鏂潈闄愮殑鍦ˋction涓婂姞涓夾piActionPermission灞炴�ф爣璇嗘潈闄愮被鍒紝ActionPermissionFilter浣滄潈闄愬鐞� + ///(string,string,string)1銆佽姹傚弬鏁�,2銆佽繑鍥炴秷鎭紝3,寮傚父娑堟伅,4鐘舵�� + /// </summary> + /// <param name="context"></param> + public void OnAuthorization(AuthorizationFilterContext context) + { + //if (!App.HostEnvironment.IsProduction() || context.HttpContext.Request.Path.Value == loginPath || context.HttpContext.Request.Path.Value == vierificationCodePath) + //{ + if (context.ActionDescriptor.EndpointMetadata.Any(item => item is IAllowAnonymous)) + { + //濡傛灉浣跨敤浜嗗浐瀹歍oken涓嶈繃鏈燂紝鐩存帴瀵箃oken鐨勫悎娉曟�у強token鏄惁瀛樺湪杩涜楠岃瘉 + //if (context.Filters + // .Where(item => item is IFixedTokenFilter) + // .FirstOrDefault() is IFixedTokenFilter tokenFilter) + //{ + // tokenFilter.OnAuthorization(context); + // return; + //} + //鍖垮悕骞朵紶鍏ヤ簡token锛岄渶瑕佸皢鐢ㄦ埛鐨処D缂撳瓨璧锋潵锛屼繚璇乁serHelper閲岃兘姝g‘鑾峰彇鍒扮敤鎴蜂俊鎭� + if (!context.HttpContext.User.Identity.IsAuthenticated + && !string.IsNullOrEmpty(context.HttpContext.Request.Headers[AppSecret.TokenHeaderName])) + { + context.AddIdentity(); + } + return; + } + //} + //else + //{ + // if (!context.HttpContext.User.Identity.IsAuthenticated + // || !context.HttpContext.Request.Headers.ContainsKey(AppSecret.TokenHeaderName)) + // { + // context.Unauthorized("鏈巿鏉�"); + // return; + // } + //} + + DateTime expDate = context.HttpContext.User.Claims.Where(x => x.Type == JwtRegisteredClaimNames.Exp) + .Select(x => x.Value).FirstOrDefault().GetTimeSpmpToDate(); + //鍔ㄦ�佹爣璇嗗埛鏂皌oken(2021.05.01) + int ExpMinutes = AppSettings.app("ExpMinutes").ObjToInt(); + if ((expDate - DateTime.Now).TotalMinutes < ExpMinutes / 3 && context.HttpContext.Request.Path != replaceTokenPath) + { + context.HttpContext.Response.Headers.Add("widesea_exp", "1"); + } + } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Filter/ExporterHeaderFilter.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Filter/ExporterHeaderFilter.cs" new file mode 100644 index 0000000..81dc421 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Filter/ExporterHeaderFilter.cs" @@ -0,0 +1,23 @@ +锘縰sing Magicodes.ExporterAndImporter.Core.Filters; +using Magicodes.ExporterAndImporter.Core.Models; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WIDESEA_Core.Filter +{ + public class ExporterHeaderFilter : IExporterHeaderFilter + { + /// <summary> + /// 琛ㄥご绛涢�夊櫒锛堜慨鏀瑰悕绉帮級 + /// </summary> + /// <param name="exporterHeaderInfo"></param> + /// <returns></returns> + public ExporterHeaderInfo Filter(ExporterHeaderInfo exporterHeaderInfo) + { + return exporterHeaderInfo; + } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Filter/GlobalExceptionsFilter.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Filter/GlobalExceptionsFilter.cs" new file mode 100644 index 0000000..b8e02ba --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Filter/GlobalExceptionsFilter.cs" @@ -0,0 +1,93 @@ +锘縰sing Microsoft.AspNetCore.Hosting; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc.Filters; +using Microsoft.AspNetCore.Mvc.Rendering; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.SignalR; +using Microsoft.Extensions.Logging; +using StackExchange.Profiling; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Core.Helper; +using System.Reflection.Metadata; +using WIDESEA_Core.LogHelper; + +namespace WIDESEA_Core.Filter +{ + /// <summary> + /// 鍏ㄥ眬寮傚父閿欒鏃ュ織 + /// </summary> + public class GlobalExceptionsFilter : IExceptionFilter + { + private readonly IWebHostEnvironment _env; + private readonly ILogger<GlobalExceptionsFilter> _loggerHelper; + + public GlobalExceptionsFilter(IWebHostEnvironment env, ILogger<GlobalExceptionsFilter> loggerHelper) + { + _env = env; + _loggerHelper = loggerHelper; + } + + public void OnException(ExceptionContext context) + { + var json = new WebResponseContent(); + + json.Message = context.Exception.Message;//閿欒淇℃伅 + json.Code = 500;//500寮傚父 + var errorAudit = "Unable to resolve service for"; + if (!string.IsNullOrEmpty(json.Message) && json.Message.Contains(errorAudit)) + { + json.Message = json.Message.Replace(errorAudit, $"锛堣嫢鏂版坊鍔犳湇鍔★紝闇�瑕侀噸鏂扮紪璇戦」鐩級{errorAudit}"); + } + + if (_env.EnvironmentName.ObjToString().Equals("Development")) + { + json.DevMessage = context.Exception.StackTrace;//鍫嗘爤淇℃伅 + } + var res = new ContentResult(); + res.Content = json.Serialize(); + + context.Result = res; + MiniProfiler.Current.CustomTiming("Errors锛�", json.Message); + + LogLock.OutLogAOP("鍏ㄥ眬寮傚父閿欒鏃ュ織", new string[] { json.Message + WriteLog(json.Message, context.Exception) }); + //閲囩敤log4net 杩涜閿欒鏃ュ織璁板綍 + //_loggerHelper.LogError(json.Message + WriteLog(json.Message, context.Exception)); + } + + /// <summary> + /// 鑷畾涔夎繑鍥炴牸寮� + /// </summary> + /// <param name="throwMsg"></param> + /// <param name="ex"></param> + /// <returns></returns> + public string WriteLog(string throwMsg, Exception ex) + { + return string.Format("\r\n銆愯嚜瀹氫箟閿欒銆戯細{0} \r\n銆愬紓甯哥被鍨嬨�戯細{1} \r\n銆愬紓甯镐俊鎭�戯細{2} \r\n銆愬爢鏍堣皟鐢ㄣ�戯細{3}", new object[] { throwMsg, + ex.GetType().Name, ex.Message, ex.StackTrace }); + } + + } + public class InternalServerErrorObjectResult : ObjectResult + { + public InternalServerErrorObjectResult(object value) : base(value) + { + StatusCode = StatusCodes.Status500InternalServerError; + } + } + //杩斿洖閿欒淇℃伅 + public class JsonErrorResponse + { + /// <summary> + /// 鐢熶骇鐜鐨勬秷鎭� + /// </summary> + public string Message { get; set; } + /// <summary> + /// 寮�鍙戠幆澧冪殑娑堟伅 + /// </summary> + public string DevelopmentMessage { get; set; } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Filter/IFixedTokenFilter.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Filter/IFixedTokenFilter.cs" new file mode 100644 index 0000000..99368a2 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Filter/IFixedTokenFilter.cs" @@ -0,0 +1,57 @@ +锘縰sing Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc.Filters; +using System; +using System.Collections.Generic; +using System.IdentityModel.Tokens.Jwt; +using System.Linq; +using System.Net; +using System.Security.Claims; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Core.Authorization; +using WIDESEA_Core.Const; +using WIDESEA_Core.Helper; + +namespace WIDESEA_Core.Filter +{ + public interface IFixedTokenFilter : IFilterMetadata + { + AuthorizationFilterContext OnAuthorization(AuthorizationFilterContext context); + } + public class FixedTokenAttribute : Attribute, IFixedTokenFilter, IAllowAnonymous + { + public AuthorizationFilterContext OnAuthorization(AuthorizationFilterContext context) + { + string fixedoken = ""; + //濡傛灉token宸插け鏁堬紝鐩存帴鑾峰彇header閲岀殑token + if (!context.HttpContext.User.Identity.IsAuthenticated) + { + fixedoken = context.HttpContext.Request.Headers[AppSecret.TokenHeaderName]; + fixedoken = fixedoken?.Replace("Bearer ", ""); + //鍒ゆ柇鏄惁浼犲叆浜唗oken + if (string.IsNullOrEmpty(fixedoken)) + { + return context.Unauthorized("娌℃湁浼犲叆token"); + } + //瑙f瀽token + int userId = JwtHelper.GetUserId(fixedoken); + if (userId <= 0) + { + return context.Unauthorized("token涓嶆纭�"); + } + context.AddIdentity(userId); + } + else + { + fixedoken = ((ClaimsIdentity)context.HttpContext.User.Identity) + ?.BootstrapContext?.ToString(); + } + //鍒ゆ柇褰撳墠鐢ㄦ埛鐨則oken涓庣紦瀛樼殑token鏄惁鐩稿悓 + if (App.User.Token != fixedoken) + { + context.FilterResult(HttpStatusCode.Unauthorized, "token宸插け鏁�"); + } + return context; + } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Filter/UseServiceDIAttribute.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Filter/UseServiceDIAttribute.cs" new file mode 100644 index 0000000..be1d4a8 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Filter/UseServiceDIAttribute.cs" @@ -0,0 +1,38 @@ +锘縰sing Microsoft.AspNetCore.Mvc.Filters; +using Microsoft.Extensions.Logging; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WIDESEA_Core.Filter +{ + public class UseServiceDIAttribute : ActionFilterAttribute + { + + protected readonly ILogger<UseServiceDIAttribute> _logger; + //private readonly IBlogArticleServices _blogArticleServices; + private readonly string _name; + + public UseServiceDIAttribute(ILogger<UseServiceDIAttribute> logger/*, IBlogArticleServices blogArticleServices*/, string Name = "") + { + _logger = logger; + /*_blogArticleServices = blogArticleServices;*/ + _name = Name; + } + + + public override void OnActionExecuted(ActionExecutedContext context) + { + //var dd =await _blogArticleServices.Query(); + base.OnActionExecuted(context); + DeleteSubscriptionFiles(); + } + + private void DeleteSubscriptionFiles() + { + + } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Helper/AppSettings.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Helper/AppSettings.cs" new file mode 100644 index 0000000..1245695 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Helper/AppSettings.cs" @@ -0,0 +1,89 @@ +锘縰sing Microsoft.Extensions.Configuration.Json; +using Microsoft.Extensions.Configuration; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WIDESEA_Core.Helper +{ + /// <summary> + /// appsettings.json鎿嶄綔绫� + /// </summary> + public class AppSettings + { + public static IConfiguration Configuration { get; set; } + static string contentPath { get; set; } + + public AppSettings(string contentPath) + { + string Path = "appsettings.json"; + + //濡傛灉浣犳妸閰嶇疆鏂囦欢 鏄� 鏍规嵁鐜鍙橀噺鏉ュ垎寮�浜嗭紝鍙互杩欐牱鍐� + //Path = $"appsettings.{Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT")}.json"; + + Configuration = new ConfigurationBuilder() + .SetBasePath(contentPath) + .Add(new JsonConfigurationSource { Path = Path, Optional = false, ReloadOnChange = true })//杩欐牱鐨勮瘽锛屽彲浠ョ洿鎺ヨ鐩綍閲岀殑json鏂囦欢锛岃�屼笉鏄� bin 鏂囦欢澶逛笅鐨勶紝鎵�浠ヤ笉鐢ㄤ慨鏀瑰鍒跺睘鎬� + .Build(); + } + + public AppSettings(IConfiguration configuration) + { + Configuration = configuration; + } + + /// <summary> + /// 灏佽瑕佹搷浣滅殑瀛楃 + /// </summary> + /// <param name="sections">鑺傜偣閰嶇疆</param> + /// <returns></returns> + public static string app(params string[] sections) + { + try + { + + if (sections.Any()) + { + return Configuration[string.Join(":", sections)]; + } + } + catch (Exception) { } + + return ""; + } + + /// <summary> + /// 閫掑綊鑾峰彇閰嶇疆淇℃伅鏁扮粍 + /// </summary> + /// <typeparam name="T"></typeparam> + /// <param name="sections"></param> + /// <returns></returns> + public static List<T> app<T>(params string[] sections) + { + List<T> list = new List<T>(); + // 寮曠敤 Microsoft.Extensions.Configuration.Binder 鍖� + Configuration.Bind(string.Join(":", sections), list); + return list; + } + + + /// <summary> + /// 鏍规嵁璺緞 configuration["App:Name"]; + /// </summary> + /// <param name="sectionsPath"></param> + /// <returns></returns> + public static string GetValue(string sectionsPath) + { + try + { + return Configuration[sectionsPath]; + } + catch (Exception) { } + + return ""; + + } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Helper/AutoMapperHelper.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Helper/AutoMapperHelper.cs" new file mode 100644 index 0000000..cb72738 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Helper/AutoMapperHelper.cs" @@ -0,0 +1,23 @@ +锘縰sing AutoMapper; +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WIDESEA_Core.Helper +{ + + /// <summary> + /// AutoMapper鏄犲皠甯姪绫� + /// AutoMapper 鐗堟湰13.0.1 + /// </summary> + public static class AutoMapperHelper + { + + + } + + +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Helper/ConsoleHelper.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Helper/ConsoleHelper.cs" new file mode 100644 index 0000000..2cc4614 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Helper/ConsoleHelper.cs" @@ -0,0 +1,57 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WIDESEA_Core.Helper +{ + public static class ConsoleHelper + { + private static readonly object _objLock = new(); + + /// <summary> + /// 鍦ㄦ帶鍒跺彴杈撳嚭 + /// </summary> + /// <param name="str">鏂囨湰</param> + /// <param name="color">鍓嶉鑹�</param> + public static void WriteColorLine(string str, ConsoleColor color) + { + lock (_objLock) + { + ConsoleColor currentForeColor = Console.ForegroundColor; + Console.ForegroundColor = color; + Console.WriteLine(str); + Console.ForegroundColor = currentForeColor; + } + } + + /// <summary> + /// 鎵撳嵃閿欒淇℃伅 + /// </summary> + /// <param name="str">寰呮墦鍗扮殑瀛楃涓�</param> + /// <param name="color">鎯宠鎵撳嵃鐨勯鑹�</param> + public static void WriteErrorLine(this string str, ConsoleColor color = ConsoleColor.Red) => WriteColorLine(str, color); + + /// <summary> + /// 鎵撳嵃璀﹀憡淇℃伅 + /// </summary> + /// <param name="str">寰呮墦鍗扮殑瀛楃涓�</param> + /// <param name="color">鎯宠鎵撳嵃鐨勯鑹�</param> + public static void WriteWarningLine(this string str, ConsoleColor color = ConsoleColor.Yellow) => WriteColorLine(str, color); + + /// <summary> + /// 鎵撳嵃姝e父淇℃伅 + /// </summary> + /// <param name="str">寰呮墦鍗扮殑瀛楃涓�</param> + /// <param name="color">鎯宠鎵撳嵃鐨勯鑹�</param> + public static void WriteInfoLine(this string str, ConsoleColor color = ConsoleColor.White) => WriteColorLine(str, color); + + /// <summary> + /// 鎵撳嵃鎴愬姛鐨勪俊鎭� + /// </summary> + /// <param name="str">寰呮墦鍗扮殑瀛楃涓�</param> + /// <param name="color">鎯宠鎵撳嵃鐨勯鑹�</param> + public static void WriteSuccessLine(this string str, ConsoleColor color = ConsoleColor.Green) => WriteColorLine(str, color); + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Helper/ExportHelper.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Helper/ExportHelper.cs" new file mode 100644 index 0000000..6e9a8fc --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Helper/ExportHelper.cs" @@ -0,0 +1,106 @@ +锘縰sing Magicodes.ExporterAndImporter.Core; +using Magicodes.ExporterAndImporter.Excel; +using Magicodes.IE.Core; +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using System.Reflection.Emit; +using System.Text; +using System.Threading.Tasks; + +namespace WIDESEA_Core.Helper +{ + public static class ExportHelper + { + public static Type CreateDynamicClass(this PropertyInfo[] propertyInfos) + { + string className = "DynamicClass"; + AssemblyName assemblyName = new AssemblyName("WIDESEA_Model.Models"); + AssemblyBuilder assemblyBuilder = AssemblyBuilder.DefineDynamicAssembly(assemblyName, AssemblyBuilderAccess.Run);//瀹氫箟鍏锋湁鎸囧畾鍚嶇О鍜岃闂潈闄愮殑鍔ㄦ�佺▼搴忛泦 + ModuleBuilder moduleBuilder = assemblyBuilder.DefineDynamicModule("MainModule");//鍦ㄦ绋嬪簭闆嗕腑瀹氫箟鍛藉悕鐨勬殏鏃跺姩鎬佹ā鍧� + TypeBuilder typeBuilder = moduleBuilder.DefineType(className, TypeAttributes.Public);//TypeBuilder:鍦ㄨ繍琛屾椂瀹氫箟骞跺垱寤虹被鐨勬柊瀹炰緥 + + Type attributeType1 = typeof(ExcelExporterAttribute); + MethodInfo [] methodInfos = attributeType1.GetMethods(BindingFlags.Public); + ConstructorInfo[] constructorInfos2 = attributeType1.GetConstructors(); + ConstructorInfo constructorInfo2 = constructorInfos2[0]; + CustomAttributeBuilder customAttributeBuilder2 = new CustomAttributeBuilder(constructorInfo2, new object[] { }); + + typeBuilder.SetCustomAttribute(customAttributeBuilder2); + + foreach (var property in propertyInfos) + { + string propertyName = property.Name; + Type propertyType = property.PropertyType; + + FieldBuilder fieldBuilder = typeBuilder.DefineField("_" + propertyName, propertyType, FieldAttributes.Private); + PropertyBuilder propertyBuilder = typeBuilder.DefineProperty(propertyName, PropertyAttributes.HasDefault, propertyType, null); + + SugarColumn sugarColumn = property.GetCustomAttribute<SugarColumn>(); + if (sugarColumn != null) + { + Type attributeType = typeof(ExporterHeaderAttribute); + ConstructorInfo[] constructorInfos = attributeType.GetConstructors(); + ConstructorInfo constructorInfo = constructorInfos[0]; + CustomAttributeBuilder customAttributeBuilder = new CustomAttributeBuilder(constructorInfo, new object[] { sugarColumn.ColumnDescription, 11f, null, false, true, true, 0, KnownColor.Empty }); + propertyBuilder.SetCustomAttribute(customAttributeBuilder); + } + + MethodAttributes getSetAttributes = MethodAttributes.Public | MethodAttributes.SpecialName | MethodAttributes.HideBySig; + + MethodBuilder getMethodBuilder = typeBuilder.DefineMethod("get_" + propertyName, getSetAttributes, propertyType, Type.EmptyTypes); + ILGenerator getIL = getMethodBuilder.GetILGenerator(); + getIL.Emit(OpCodes.Ldarg_0); + getIL.Emit(OpCodes.Ldfld, fieldBuilder); + getIL.Emit(OpCodes.Ret); + + MethodBuilder setMethodBuilder = typeBuilder.DefineMethod("set_" + propertyName, getSetAttributes, null, new Type[] { propertyType }); + ILGenerator setIL = setMethodBuilder.GetILGenerator(); + setIL.Emit(OpCodes.Ldarg_0); + setIL.Emit(OpCodes.Ldarg_1); + setIL.Emit(OpCodes.Stfld, fieldBuilder); + setIL.Emit(OpCodes.Ret); + + propertyBuilder.SetGetMethod(getMethodBuilder); + propertyBuilder.SetSetMethod(setMethodBuilder); + + + } + + Type generatedType = typeBuilder.CreateType(); + return generatedType; + } + + public static void SetProperty(object instance, string propertyName, object value) + { + Type type = instance.GetType(); + PropertyInfo propertyInfo = type.GetProperty(propertyName); + propertyInfo.SetValue(instance, value); + } + + public static object GetProperty(object instance, string propertyName) + { + Type type = instance.GetType(); + PropertyInfo propertyInfo = type.GetProperty(propertyName); + return propertyInfo.GetValue(instance); + } + + public static void SetValue<T>(object instance, T value) + { + Type type = instance.GetType(); + + PropertyInfo[] propertyInfos = typeof(T).GetProperties(); + for (int j = 0; j < propertyInfos.Length; j++) + { + PropertyInfo propertyInfo = type.GetProperty(propertyInfos[j].Name); + object obj = propertyInfos[j].GetValue(value); + propertyInfo.SetValue(instance, obj); + ExporterHeaderAttribute exporterHeaderAttribute = propertyInfo.GetCustomAttribute<ExporterHeaderAttribute>(); + } + + } + + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Helper/FileHelper.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Helper/FileHelper.cs" new file mode 100644 index 0000000..9a83b21 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Helper/FileHelper.cs" @@ -0,0 +1,428 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WIDESEA_Core.Helper +{ + public class FileHelper : IDisposable + { + + private bool _alreadyDispose = false; + + #region 鏋勯�犲嚱鏁� + public FileHelper() + { + + } + ~FileHelper() + { + Dispose(); ; + } + + protected virtual void Dispose(bool isDisposing) + { + if (_alreadyDispose) return; + _alreadyDispose = true; + } + #endregion + + #region IDisposable 鎴愬憳 + + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + + #endregion + + #region 鍙栧緱鏂囦欢鍚庣紑鍚� + /**************************************** + * 鍑芥暟鍚嶇О锛欸etPostfixStr + * 鍔熻兘璇存槑锛氬彇寰楁枃浠跺悗缂�鍚� + * 鍙� 鏁帮細filename:鏂囦欢鍚嶇О + * 璋冪敤绀哄垪锛� + * string filename = "aaa.aspx"; + * string s = EC.FileObj.GetPostfixStr(filename); + *****************************************/ + /// <summary> + /// 鍙栧悗缂�鍚� + /// </summary> + /// <param name="filename">鏂囦欢鍚�</param> + /// <returns>.gif|.html鏍煎紡</returns> + public static string GetPostfixStr(string filename) + { + int start = filename.LastIndexOf("."); + int length = filename.Length; + string postfix = filename.Substring(start, length - start); + return postfix; + } + #endregion + + #region 鏍规嵁鏂囦欢澶у皬鑾峰彇鎸囧畾鍓嶇紑鐨勫彲鐢ㄦ枃浠跺悕 + /// <summary> + /// 鏍规嵁鏂囦欢澶у皬鑾峰彇鎸囧畾鍓嶇紑鐨勫彲鐢ㄦ枃浠跺悕 + /// </summary> + /// <param name="folderPath">鏂囦欢澶�</param> + /// <param name="prefix">鏂囦欢鍓嶇紑</param> + /// <param name="size">鏂囦欢澶у皬(1m)</param> + /// <param name="ext">鏂囦欢鍚庣紑(.log)</param> + /// <returns>鍙敤鏂囦欢鍚�</returns> + public static string GetAvailableFileWithPrefixOrderSize(string folderPath, string prefix, int size = 1 * 1024 * 1024, string ext = ".log") + { + var allFiles = new DirectoryInfo(folderPath); + var selectFiles = allFiles.GetFiles().Where(fi => fi.Name.ToLower().Contains(prefix.ToLower()) && fi.Extension.ToLower() == ext.ToLower() && fi.Length < size).OrderByDescending(d => d.Name).ToList(); + + if (selectFiles.Count > 0) + { + return selectFiles.FirstOrDefault().FullName; + } + + return Path.Combine(folderPath, $@"{prefix}_{DateTime.Now.DateToTimeStamp()}.log"); + } + public static string GetAvailableFileNameWithPrefixOrderSize(string _contentRoot, string prefix, int size = 1 * 1024 * 1024, string ext = ".log") + { + var folderPath = Path.Combine(_contentRoot, "Log"); + if (!Directory.Exists(folderPath)) + { + Directory.CreateDirectory(folderPath); + } + + var allFiles = new DirectoryInfo(folderPath); + var selectFiles = allFiles.GetFiles().Where(fi => fi.Name.ToLower().Contains(prefix.ToLower()) && fi.Extension.ToLower() == ext.ToLower() && fi.Length < size).OrderByDescending(d => d.Name).ToList(); + + if (selectFiles.Count > 0) + { + return selectFiles.FirstOrDefault().Name.Replace(".log", ""); + } + + return $@"{prefix}_{DateTime.Now.DateToTimeStamp()}"; + } + #endregion + + #region 鍐欐枃浠� + /**************************************** + * 鍑芥暟鍚嶇О锛歐riteFile + * 鍔熻兘璇存槑锛氬啓鏂囦欢,浼氳鐩栨帀浠ュ墠鐨勫唴瀹� + * 鍙� 鏁帮細Path:鏂囦欢璺緞,Strings:鏂囨湰鍐呭 + * 璋冪敤绀哄垪锛� + * string Path = Server.MapPath("Default2.aspx"); + * string Strings = "杩欐槸鎴戝啓鐨勫唴瀹瑰晩"; + * EC.FileObj.WriteFile(Path,Strings); + *****************************************/ + /// <summary> + /// 鍐欐枃浠� + /// </summary> + /// <param name="Path">鏂囦欢璺緞</param> + /// <param name="Strings">鏂囦欢鍐呭</param> + public static void WriteFile(string Path, string Strings) + { + if (!File.Exists(Path)) + { + FileStream f = File.Create(Path); + f.Close(); + } + StreamWriter f2 = new StreamWriter(Path, false, System.Text.Encoding.GetEncoding("gb2312")); + f2.Write(Strings); + f2.Close(); + f2.Dispose(); + } + /// <summary> + /// 鍐欐枃浠� + /// </summary> + /// <param name="Path">鏂囦欢璺緞</param> + /// <param name="Strings">鏂囦欢鍐呭</param> + public static void WriteFile(string Path, byte[] buf) + { + if (!File.Exists(Path)) + { + FileStream f = File.Create(Path); + f.Close(); + } + FileStream f2 = new FileStream(Path, FileMode.Create, FileAccess.Write); + f2.Write(buf, 0, buf.Length); + f2.Close(); + f2.Dispose(); + } + + public static void WriteFile(string Path, string fileName, byte[] buf) + { + if (!Directory.Exists(Path)) + { + Directory.CreateDirectory(Path); + } + if (!File.Exists(Path + "\\" + fileName)) + { + FileStream f = File.Create(Path + "\\" + fileName); + f.Close(); + } + FileStream f2 = new FileStream(Path + "\\" + fileName, FileMode.Create, FileAccess.Write); + f2.Write(buf, 0, buf.Length); + f2.Close(); + f2.Dispose(); + } + + /// <summary> + /// 鍐欐枃浠� + /// </summary> + /// <param name="Path">鏂囦欢璺緞</param> + /// <param name="Strings">鏂囦欢鍐呭</param> + /// <param name="encode">缂栫爜鏍煎紡</param> + public static void WriteFile(string Path, string Strings, Encoding encode) + { + if (!File.Exists(Path)) + { + FileStream f = File.Create(Path); + f.Close(); + } + StreamWriter f2 = new StreamWriter(Path, false, encode); + f2.Write(Strings); + f2.Close(); + f2.Dispose(); + } + #endregion + + #region 璇绘枃浠� + /**************************************** + * 鍑芥暟鍚嶇О锛歊eadFile + * 鍔熻兘璇存槑锛氳鍙栨枃鏈唴瀹� + * 鍙� 鏁帮細Path:鏂囦欢璺緞 + * 璋冪敤绀哄垪锛� + * string Path = Server.MapPath("Default2.aspx"); + * string s = EC.FileObj.ReadFile(Path); + *****************************************/ + /// <summary> + /// 璇绘枃浠� + /// </summary> + /// <param name="Path">鏂囦欢璺緞</param> + /// <returns></returns> + public static string ReadFile(string Path) + { + string s = ""; + if (!File.Exists(Path)) + s = "涓嶅瓨鍦ㄧ浉搴旂殑鐩綍"; + else + { + StreamReader f2 = new StreamReader(Path, System.Text.Encoding.GetEncoding("gb2312")); + s = f2.ReadToEnd(); + f2.Close(); + f2.Dispose(); + } + + return s; + } + + /// <summary> + /// 璇绘枃浠� + /// </summary> + /// <param name="Path">鏂囦欢璺緞</param> + /// <param name="encode">缂栫爜鏍煎紡</param> + /// <returns></returns> + public static string ReadFile(string Path, Encoding encode) + { + string s = ""; + if (!File.Exists(Path)) + s = "涓嶅瓨鍦ㄧ浉搴旂殑鐩綍"; + else + { + StreamReader f2 = new StreamReader(Path, encode); + s = f2.ReadToEnd(); + f2.Close(); + f2.Dispose(); + } + + return s; + } + #endregion + + #region 杩藉姞鏂囦欢 + /**************************************** + * 鍑芥暟鍚嶇О锛欶ileAdd + * 鍔熻兘璇存槑锛氳拷鍔犳枃浠跺唴瀹� + * 鍙� 鏁帮細Path:鏂囦欢璺緞,strings:鍐呭 + * 璋冪敤绀哄垪锛� + * string Path = Server.MapPath("Default2.aspx"); + * string Strings = "鏂拌拷鍔犲唴瀹�"; + * EC.FileObj.FileAdd(Path, Strings); + *****************************************/ + /// <summary> + /// 杩藉姞鏂囦欢 + /// </summary> + /// <param name="Path">鏂囦欢璺緞</param> + /// <param name="strings">鍐呭</param> + public static void FileAdd(string Path, string strings) + { + StreamWriter sw = File.AppendText(Path); + sw.Write(strings); + sw.Flush(); + sw.Close(); + } + #endregion + + #region 鎷疯礉鏂囦欢 + /**************************************** + * 鍑芥暟鍚嶇О锛欶ileCoppy + * 鍔熻兘璇存槑锛氭嫹璐濇枃浠� + * 鍙� 鏁帮細OrignFile:鍘熷鏂囦欢,NewFile:鏂版枃浠惰矾寰� + * 璋冪敤绀哄垪锛� + * string orignFile = Server.MapPath("Default2.aspx"); + * string NewFile = Server.MapPath("Default3.aspx"); + * EC.FileObj.FileCoppy(OrignFile, NewFile); + *****************************************/ + /// <summary> + /// 鎷疯礉鏂囦欢 + /// </summary> + /// <param name="OrignFile">鍘熷鏂囦欢</param> + /// <param name="NewFile">鏂版枃浠惰矾寰�</param> + public static void FileCoppy(string orignFile, string NewFile) + { + File.Copy(orignFile, NewFile, true); + } + + #endregion + + #region 鍒犻櫎鏂囦欢 + /**************************************** + * 鍑芥暟鍚嶇О锛欶ileDel + * 鍔熻兘璇存槑锛氬垹闄ゆ枃浠� + * 鍙� 鏁帮細Path:鏂囦欢璺緞 + * 璋冪敤绀哄垪锛� + * string Path = Server.MapPath("Default3.aspx"); + * EC.FileObj.FileDel(Path); + *****************************************/ + /// <summary> + /// 鍒犻櫎鏂囦欢 + /// </summary> + /// <param name="Path">璺緞</param> + public static void FileDel(string Path) + { + File.Delete(Path); + } + #endregion + + #region 绉诲姩鏂囦欢 + /**************************************** + * 鍑芥暟鍚嶇О锛欶ileMove + * 鍔熻兘璇存槑锛氱Щ鍔ㄦ枃浠� + * 鍙� 鏁帮細OrignFile:鍘熷璺緞,NewFile:鏂版枃浠惰矾寰� + * 璋冪敤绀哄垪锛� + * string orignFile = Server.MapPath("../璇存槑.txt"); + * string NewFile = Server.MapPath("http://www.cnblogs.com/璇存槑.txt"); + * EC.FileObj.FileMove(OrignFile, NewFile); + *****************************************/ + /// <summary> + /// 绉诲姩鏂囦欢 + /// </summary> + /// <param name="OrignFile">鍘熷璺緞</param> + /// <param name="NewFile">鏂拌矾寰�</param> + public static void FileMove(string orignFile, string NewFile) + { + File.Move(orignFile, NewFile); + } + #endregion + + #region 鍦ㄥ綋鍓嶇洰褰曚笅鍒涘缓鐩綍 + /**************************************** + * 鍑芥暟鍚嶇О锛欶olderCreate + * 鍔熻兘璇存槑锛氬湪褰撳墠鐩綍涓嬪垱寤虹洰褰� + * 鍙� 鏁帮細OrignFolder:褰撳墠鐩綍,NewFloder:鏂扮洰褰� + * 璋冪敤绀哄垪锛� + * string orignFolder = Server.MapPath("test/"); + * string NewFloder = "new"; + * EC.FileObj.FolderCreate(OrignFolder, NewFloder); + *****************************************/ + /// <summary> + /// 鍦ㄥ綋鍓嶇洰褰曚笅鍒涘缓鐩綍 + /// </summary> + /// <param name="OrignFolder">褰撳墠鐩綍</param> + /// <param name="NewFloder">鏂扮洰褰�</param> + public static void FolderCreate(string orignFolder, string NewFloder) + { + Directory.SetCurrentDirectory(orignFolder); + Directory.CreateDirectory(NewFloder); + } + #endregion + + #region 閫掑綊鍒犻櫎鏂囦欢澶圭洰褰曞強鏂囦欢 + /**************************************** + * 鍑芥暟鍚嶇О锛欴eleteFolder + * 鍔熻兘璇存槑锛氶�掑綊鍒犻櫎鏂囦欢澶圭洰褰曞強鏂囦欢 + * 鍙� 鏁帮細dir:鏂囦欢澶硅矾寰� + * 璋冪敤绀哄垪锛� + * string dir = Server.MapPath("test/"); + * EC.FileObj.DeleteFolder(dir); + *****************************************/ + /// <summary> + /// 閫掑綊鍒犻櫎鏂囦欢澶圭洰褰曞強鏂囦欢 + /// </summary> + /// <param name="dir"></param> + /// <returns></returns> + public static void DeleteFolder(string dir) + { + if (Directory.Exists(dir)) //濡傛灉瀛樺湪杩欎釜鏂囦欢澶瑰垹闄や箣 + { + foreach (string d in Directory.GetFileSystemEntries(dir)) + { + if (File.Exists(d)) + File.Delete(d); //鐩存帴鍒犻櫎鍏朵腑鐨勬枃浠� + else + DeleteFolder(d); //閫掑綊鍒犻櫎瀛愭枃浠跺す + } + Directory.Delete(dir); //鍒犻櫎宸茬┖鏂囦欢澶� + } + + } + #endregion + + #region 灏嗘寚瀹氭枃浠跺す涓嬮潰鐨勬墍鏈夊唴瀹筩opy鍒扮洰鏍囨枃浠跺す涓嬮潰 鏋滅洰鏍囨枃浠跺す涓哄彧璇诲睘鎬у氨浼氭姤閿欍�� + /**************************************** + * 鍑芥暟鍚嶇О锛欳opyDir + * 鍔熻兘璇存槑锛氬皢鎸囧畾鏂囦欢澶逛笅闈㈢殑鎵�鏈夊唴瀹筩opy鍒扮洰鏍囨枃浠跺す涓嬮潰 鏋滅洰鏍囨枃浠跺す涓哄彧璇诲睘鎬у氨浼氭姤閿欍�� + * 鍙� 鏁帮細srcPath:鍘熷璺緞,aimPath:鐩爣鏂囦欢澶� + * 璋冪敤绀哄垪锛� + * string srcPath = Server.MapPath("test/"); + * string aimPath = Server.MapPath("test1/"); + * EC.FileObj.CopyDir(srcPath,aimPath); + *****************************************/ + /// <summary> + /// 鎸囧畾鏂囦欢澶逛笅闈㈢殑鎵�鏈夊唴瀹筩opy鍒扮洰鏍囨枃浠跺す涓嬮潰 + /// </summary> + /// <param name="srcPath">鍘熷璺緞</param> + /// <param name="aimPath">鐩爣鏂囦欢澶�</param> + public static void CopyDir(string srcPath, string aimPath) + { + try + { + // 妫�鏌ョ洰鏍囩洰褰曟槸鍚︿互鐩綍鍒嗗壊瀛楃缁撴潫濡傛灉涓嶆槸鍒欐坊鍔犱箣 + if (aimPath[aimPath.Length - 1] != Path.DirectorySeparatorChar) + aimPath += Path.DirectorySeparatorChar; + // 鍒ゆ柇鐩爣鐩綍鏄惁瀛樺湪濡傛灉涓嶅瓨鍦ㄥ垯鏂板缓涔� + if (!Directory.Exists(aimPath)) + Directory.CreateDirectory(aimPath); + // 寰楀埌婧愮洰褰曠殑鏂囦欢鍒楄〃锛岃閲岄潰鏄寘鍚枃浠朵互鍙婄洰褰曡矾寰勭殑涓�涓暟缁� + //濡傛灉浣犳寚鍚慶opy鐩爣鏂囦欢涓嬮潰鐨勬枃浠惰�屼笉鍖呭惈鐩綍璇蜂娇鐢ㄤ笅闈㈢殑鏂规硶 + //string[] fileList = Directory.GetFiles(srcPath); + string[] fileList = Directory.GetFileSystemEntries(srcPath); + //閬嶅巻鎵�鏈夌殑鏂囦欢鍜岀洰褰� + foreach (string file in fileList) + { + //鍏堝綋浣滅洰褰曞鐞嗗鏋滃瓨鍦ㄨ繖涓洰褰曞氨閫掑綊Copy璇ョ洰褰曚笅闈㈢殑鏂囦欢 + + if (Directory.Exists(file)) + CopyDir(file, aimPath + Path.GetFileName(file)); + //鍚﹀垯鐩存帴Copy鏂囦欢 + else + File.Copy(file, aimPath + Path.GetFileName(file), true); + } + + } + catch (Exception ee) + { + throw new Exception(ee.ToString()); + } + } + #endregion + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Helper/HttpContextHelper.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Helper/HttpContextHelper.cs" new file mode 100644 index 0000000..d0d23cd --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Helper/HttpContextHelper.cs" @@ -0,0 +1,36 @@ +锘縰sing Microsoft.AspNetCore.Http; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WIDESEA_Core.Helper +{ + public static class HttpContextHelper + { + public static string GetUserIp(this HttpContext context) + { + string realIP = null; + string forwarded = null; + string remoteIpAddress = context.Connection.RemoteIpAddress.ToString(); + if (context.Request.Headers.ContainsKey("X-Real-IP")) + { + realIP = context.Request.Headers["X-Real-IP"].ToString(); + if (realIP != remoteIpAddress) + { + remoteIpAddress = realIP; + } + } + if (context.Request.Headers.ContainsKey("X-Forwarded-For")) + { + forwarded = context.Request.Headers["X-Forwarded-For"].ToString(); + if (forwarded != remoteIpAddress) + { + remoteIpAddress = forwarded; + } + } + return remoteIpAddress; + } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Helper/HttpHelper.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Helper/HttpHelper.cs" new file mode 100644 index 0000000..54c3eba --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Helper/HttpHelper.cs" @@ -0,0 +1,112 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Net.Http.Headers; +using System.Text; +using System.Threading.Tasks; + +namespace WIDESEA_Core.Helper +{ + public class HttpHelper + { + public static async Task<string> GetAsync(string serviceAddress, string contentType = "application/json", Dictionary<string, string>? headers = null) + { + try + { + string result = string.Empty; + using HttpClient httpClient = new HttpClient(); + httpClient.Timeout = new TimeSpan(0, 0, 60); + + if (headers != null) + { + foreach (var header in headers) + httpClient.DefaultRequestHeaders.Add(header.Key, header.Value); + } + + result = await httpClient.GetAsync(serviceAddress).Result.Content.ReadAsStringAsync(); + return result; + } + catch (Exception e) + { + Console.WriteLine(e.Message); + } + return null; + } + + public static async Task<string> PostAsync(string serviceAddress, string requestJson = null, string contentType = "application/json", Dictionary<string, string>? headers = null) + { + try + { + string result = string.Empty; + using (HttpContent httpContent = new StringContent(requestJson)) + { + httpContent.Headers.ContentType = new MediaTypeHeaderValue("application/json"); + using HttpClient httpClient = new HttpClient(); + httpClient.Timeout = new TimeSpan(0, 0, 60); + + if (headers != null) + { + foreach (var header in headers) + httpClient.DefaultRequestHeaders.Add(header.Key, header.Value); + } + + result = await httpClient.PostAsync(serviceAddress, httpContent).Result.Content.ReadAsStringAsync(); + } + return result; + } + catch (Exception e) + { + Console.WriteLine(e.Message); + } + return null; + } + + public static string Get(string serviceAddress, string contentType = "application/json", Dictionary<string, string>? headers = null) + { + try + { + string result = string.Empty; + using HttpClient httpClient = new HttpClient(); + httpClient.Timeout = new TimeSpan(0, 0, 60); + + foreach (var header in headers) + httpClient.DefaultRequestHeaders.Add(header.Key, header.Value); + + result = httpClient.GetStringAsync(serviceAddress).Result; + return result; + } + catch (Exception e) + { + Console.WriteLine(e.Message); + } + return null; + } + + public static string Post(string serviceAddress, string requestJson = null, string contentType = "application/json", Dictionary<string, string>? headers = null) + { + try + { + string result = string.Empty; + using (HttpContent httpContent = new StringContent(requestJson)) + { + httpContent.Headers.ContentType = new MediaTypeHeaderValue("application/json"); + using HttpClient httpClient = new HttpClient(); + httpClient.Timeout = new TimeSpan(0, 0, 60); + + if (headers != null) + { + foreach (var header in headers) + httpClient.DefaultRequestHeaders.Add(header.Key, header.Value); + } + result = httpClient.PostAsync(serviceAddress, httpContent).Result.Content.ReadAsStringAsync().Result; + } + return result; + } + catch (Exception e) + { + Console.WriteLine(e.Message); + } + return null; + } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Helper/MethodInfoExtensions.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Helper/MethodInfoExtensions.cs" new file mode 100644 index 0000000..63edd4b --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Helper/MethodInfoExtensions.cs" @@ -0,0 +1,22 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using System.Text; +using System.Threading.Tasks; + +namespace WIDESEA_Core.Helper +{ + public static class MethodInfoExtensions + { + public static string GetFullName(this MethodInfo method) + { + if (method.DeclaringType == null) + { + return $@"{method.Name}"; + } + + return $"{method.DeclaringType.FullName}.{method.Name}"; + } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Helper/ObjectExtension.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Helper/ObjectExtension.cs" new file mode 100644 index 0000000..1707c35 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Helper/ObjectExtension.cs" @@ -0,0 +1,51 @@ +锘縰sing Microsoft.Extensions.Primitives; +using Microsoft.IdentityModel.Tokens; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using System.Text; +using System.Threading.Tasks; + +namespace WIDESEA_Core.Helper +{ + public static class ObjectExtension + { + public static List<T> DicToIEnumerable<T>(this List<Dictionary<string, object>> dicList) + { + List<T> list = new List<T>(); + foreach (Dictionary<string, object> dic in dicList) + { + list.Add(dic.DicToModel<T>()); + } + return list; + } + + public static T DicToModel<T>(this Dictionary<string, object> dic) + { + T model = Activator.CreateInstance<T>(); + PropertyInfo[] propertyInfos = typeof(T).GetProperties(BindingFlags.GetProperty | BindingFlags.Public | BindingFlags.Instance); + foreach (var property in propertyInfos) + { + object value = null; + if (!dic.TryGetValue(property.Name, out value)) + { + if (!dic.TryGetValue(property.Name.FirstLetterToUpper(), out value)) + { + if (!dic.TryGetValue(property.Name.FirstLetterToLower(), out value)) + { + continue; + } + } + } + // 妫�鏌ユ槸鍚︿负绌哄瓧绗︿覆 + if (!string.IsNullOrEmpty(value?.ToString())) + { + // 灏嗗�艰浆鎹负灞炴�х殑绫诲瀷骞惰缃睘鎬у�� + property.SetValue(model, value.ChangeType(property.PropertyType)); + } + } + return model; + } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Helper/RuntimeExtension.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Helper/RuntimeExtension.cs" new file mode 100644 index 0000000..20f5b5b --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Helper/RuntimeExtension.cs" @@ -0,0 +1,89 @@ +锘縰sing log4net; +using Microsoft.Extensions.DependencyModel; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using System.Runtime.Loader; +using System.Text; +using System.Threading.Tasks; + +namespace WIDESEA_Core.Helper +{ + public static class RuntimeExtension + { + /// <summary> + /// 鑾峰彇椤圭洰绋嬪簭闆嗭紝鎺掗櫎鎵�鏈夌殑绯荤粺绋嬪簭闆�(Microsoft.***銆丼ystem.***绛�)銆丯uget涓嬭浇鍖� + /// </summary> + /// <returns></returns> + public static IList<Assembly> GetAllAssemblies() + { + var list = new List<Assembly>(); + var deps = DependencyContext.Default; + //鍙姞杞介」鐩腑鐨勭▼搴忛泦 + var libs = deps.CompileLibraries.Where(lib => !lib.Serviceable && lib.Type == "project"); //鎺掗櫎鎵�鏈夌殑绯荤粺绋嬪簭闆嗐�丯uget涓嬭浇鍖� + foreach (var lib in libs) + { + try + { + var assembly = AssemblyLoadContext.Default.LoadFromAssemblyName(new AssemblyName(lib.Name)); + list.Add(assembly); + } + catch (Exception e) + { + //Log.Debug(e, "GetAllAssemblies Exception:{ex}", e.Message); + } + } + + return list; + } + + public static Assembly GetAssembly(string assemblyName) + { + return GetAllAssemblies().FirstOrDefault(assembly => assembly.FullName.Contains(assemblyName)); + } + + public static IList<Type> GetAllTypes() + { + var list = new List<Type>(); + foreach (var assembly in GetAllAssemblies()) + { + var typeInfos = assembly.DefinedTypes; + foreach (var typeInfo in typeInfos) + { + list.Add(typeInfo.AsType()); + } + } + + return list; + } + + public static IList<Type> GetTypesByAssembly(string assemblyName) + { + var list = new List<Type>(); + var assembly = AssemblyLoadContext.Default.LoadFromAssemblyName(new AssemblyName(assemblyName)); + var typeInfos = assembly.DefinedTypes; + foreach (var typeInfo in typeInfos) + { + list.Add(typeInfo.AsType()); + } + + return list; + } + + public static Type GetImplementType(string typeName, Type baseInterfaceType) + { + return GetAllTypes().FirstOrDefault(t => + { + if (t.Name == typeName && + t.GetTypeInfo().GetInterfaces().Any(b => b.Name == baseInterfaceType.Name)) + { + var typeInfo = t.GetTypeInfo(); + return typeInfo.IsClass && !typeInfo.IsAbstract && !typeInfo.IsGenericType; + } + + return false; + }); + } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Helper/SecurityEncDecryptHelper.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Helper/SecurityEncDecryptHelper.cs" new file mode 100644 index 0000000..43f564c --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Helper/SecurityEncDecryptHelper.cs" @@ -0,0 +1,89 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Security.Cryptography; +using System.Text; +using System.Threading.Tasks; + +namespace WIDESEA_Core.Helper +{ + public static class SecurityEncDecryptHelper + { + private static byte[] Keys = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F }; + /// <summary> + /// DES鍔犲瘑瀛楃涓� + /// </summary> + /// <param name="encryptString">寰呭姞瀵嗙殑瀛楃涓�</param> + /// <param name="encryptKey">鍔犲瘑瀵嗛挜,瑕佹眰涓�16浣�</param> + /// <returns>鍔犲瘑鎴愬姛杩斿洖鍔犲瘑鍚庣殑瀛楃涓诧紝澶辫触杩斿洖婧愪覆</returns> + + public static string EncryptDES(this string encryptString, string encryptKey) + { + try + { + byte[] rgbKey = Encoding.UTF8.GetBytes(encryptKey.Substring(0, 16)); + byte[] rgbIV = Keys; + byte[] inputByteArray = Encoding.UTF8.GetBytes(encryptString); + + using (var DCSP = Aes.Create()) + { + using (MemoryStream mStream = new MemoryStream()) + { + using (CryptoStream cStream = new CryptoStream(mStream, DCSP.CreateEncryptor(rgbKey, rgbIV), CryptoStreamMode.Write)) + { + cStream.Write(inputByteArray, 0, inputByteArray.Length); + cStream.FlushFinalBlock(); + return Convert.ToBase64String(mStream.ToArray()).Replace('+', '_').Replace('/', '~'); + } + } + } + } + catch (Exception ex) + { + throw new Exception("瀵嗙爜鍔犲瘑寮傚父" + ex.Message); + } + + } + + /// <summary> + /// DES瑙e瘑瀛楃涓� + /// </summary> + /// <param name="decryptString">寰呰В瀵嗙殑瀛楃涓�</param> + /// <param name="decryptKey">瑙e瘑瀵嗛挜,瑕佹眰涓�16浣�,鍜屽姞瀵嗗瘑閽ョ浉鍚�</param> + /// <returns>瑙e瘑鎴愬姛杩斿洖瑙e瘑鍚庣殑瀛楃涓诧紝澶辫触杩旀簮涓�</returns> + + public static string DecryptDES(this string decryptString, string decryptKey) + { + byte[] rgbKey = Encoding.UTF8.GetBytes(decryptKey.Substring(0, 16)); + byte[] rgbIV = Keys; + byte[] inputByteArray = Convert.FromBase64String(decryptString.Replace('_', '+').Replace('~', '/')); + using (var DCSP = Aes.Create()) + { + using (MemoryStream mStream = new MemoryStream()) + { + using (CryptoStream cStream = new CryptoStream(mStream, DCSP.CreateDecryptor(rgbKey, rgbIV), CryptoStreamMode.Write)) + { + byte[] inputByteArrays = new byte[inputByteArray.Length]; + cStream.Write(inputByteArray, 0, inputByteArray.Length); + cStream.FlushFinalBlock(); + return Encoding.UTF8.GetString(mStream.ToArray()); + } + } + } + + } + public static bool TryDecryptDES(this string decryptString, string decryptKey, out string result) + { + result = ""; + try + { + result = DecryptDES(decryptString, decryptKey); + return true; + } + catch + { + return false; + } + } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Helper/SqlSugarHelper.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Helper/SqlSugarHelper.cs" new file mode 100644 index 0000000..5d304cd --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Helper/SqlSugarHelper.cs" @@ -0,0 +1,40 @@ +锘縰sing SqlSugar; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Core.DB; +using WIDESEA_Core.Seed; + +namespace WIDESEA_Core.Helper +{ + public class SqlSugarHelper + { + //澶氬簱鎯呭喌涓嬩娇鐢ㄨ鏄庯細 + //濡傛灉鏄浐瀹氬搴撳彲浠ヤ紶 new SqlSugarScope(List<ConnectionConfig>,db=>{}) 鏂囨。锛氬绉熸埛 + //濡傛灉鏄笉鍥哄畾澶氬簱 鍙互鐪嬫枃妗aas鍒嗗簱 + //鐢ㄥ崟渚嬫ā寮� + public static SqlSugarScope DbWCS = new SqlSugarScope(new ConnectionConfig() + { + //ConnectionString = DBContext.GetMainConnectionDb().Connection, + ConnectionString = AppSettings.app(MainDb.ConnectionStringWCS), + DbType = DbType.SqlServer,//鏁版嵁搴撶被鍨� + IsAutoCloseConnection = true //涓嶈鎴恡rue瑕佹墜鍔╟lose + }, + db => + { + }); + + public static SqlSugarScope DbWMS = new SqlSugarScope(new ConnectionConfig() + { + ConnectionString = DBContext.GetMainConnectionDb().Connection, + //ConnectionString = AppSettings.app(MainDb.ConnectionStringWCS), + DbType = DbType.SqlServer,//鏁版嵁搴撶被鍨� + IsAutoCloseConnection = true //涓嶈鎴恡rue瑕佹墜鍔╟lose + }, + db => + { + }); + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Helper/UtilConvert.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Helper/UtilConvert.cs" new file mode 100644 index 0000000..ae82614 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Helper/UtilConvert.cs" @@ -0,0 +1,970 @@ +锘縰sing Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.Data; +using System.Linq; +using System.Reflection; +using System.Text; +using System.Text.RegularExpressions; +using System.Threading.Tasks; +using System.Web; +using WIDESEA_Core.Const; +using WIDESEA_Core.Enums; + +namespace WIDESEA_Core.Helper +{ + public static class UtilConvert + { + private static DateTime dateStart = new DateTime(1970, 1, 1, 8, 0, 0); + + private static long longTime = 621355968000000000; + + private static int samllTime = 10000000; + /// <summary> + /// 鏃堕棿鎴宠浆鎹㈡垚鏃ユ湡 + /// </summary> + /// <param name="timeStamp"></param> + /// <returns></returns> + public static DateTime GetTimeSpmpToDate(this object timeStamp) + { + if (timeStamp == null) return dateStart; + DateTime dateTime = new DateTime(longTime + Convert.ToInt64(timeStamp) * samllTime, DateTimeKind.Utc).ToLocalTime(); + return dateTime; + } + + public static string Serialize(this object obj, JsonSerializerSettings formatDate = null) + { + if (obj == null) return null; + formatDate = formatDate ?? new JsonSerializerSettings + { + DateFormatString = "yyyy-MM-dd HH:mm:ss" + }; + return JsonConvert.SerializeObject(obj, formatDate); + } + + public static T DeserializeObject<T>(this string json) + { + if (string.IsNullOrEmpty(json)) + { + return default(T); + } + if (json == "{}") + { + json = "[]"; + } + return JsonConvert.DeserializeObject<T>(json); + } + + public static string FirstLetterToLower(this string thisValue) + { + if (string.IsNullOrEmpty(thisValue)) return string.Empty; + string result = thisValue.Substring(0, 1).ToLower() + thisValue.Substring(1, thisValue.Length - 1); + return result; + } + + public static string FirstLetterToUpper(this string thisValue) + { + if (string.IsNullOrEmpty(thisValue)) return string.Empty; + string result = thisValue.Substring(0, 1).ToUpper() + thisValue.Substring(1, thisValue.Length - 1); + return result; + } + + /// <summary> + /// + /// </summary> + /// <param name="thisValue"></param> + /// <returns></returns> + public static int ObjToInt(this object thisValue) + { + int reval = 0; + if (thisValue == null) return 0; + if (thisValue != DBNull.Value && int.TryParse(thisValue.ToString(), out reval)) + { + return reval; + } + + return reval; + } + + /// <summary> + /// + /// </summary> + /// <param name="thisValue"></param> + /// <returns></returns> + public static int DoubleToInt(this double thisValue) + { + int reval = 0; + + return Convert.ToInt32(thisValue); + } + + /// <summary> + /// + /// </summary> + /// <param name="thisValue"></param> + /// <param name="errorValue"></param> + /// <returns></returns> + public static int ObjToInt(this object thisValue, int errorValue) + { + int reval = 0; + if (thisValue != null && thisValue != DBNull.Value && int.TryParse(thisValue.ToString(), out reval)) + { + return reval; + } + + return errorValue; + } + + public static long ObjToLong(this object thisValue) + { + long reval = 0; + if (thisValue == null) return 0; + if (thisValue != DBNull.Value && long.TryParse(thisValue.ToString(), out reval)) + { + return reval; + } + + return reval; + } + + /// <summary> + /// + /// </summary> + /// <param name="thisValue"></param> + /// <returns></returns> + public static double ObjToMoney(this object thisValue) + { + double reval = 0; + if (thisValue != null && thisValue != DBNull.Value && double.TryParse(thisValue.ToString(), out reval)) + { + return reval; + } + + return 0; + } + + /// <summary> + /// + /// </summary> + /// <param name="thisValue"></param> + /// <param name="errorValue"></param> + /// <returns></returns> + public static double ObjToMoney(this object thisValue, double errorValue) + { + double reval = 0; + if (thisValue != null && thisValue != DBNull.Value && double.TryParse(thisValue.ToString(), out reval)) + { + return reval; + } + + return errorValue; + } + + /// <summary> + /// + /// </summary> + /// <param name="thisValue"></param> + /// <returns></returns> + public static string ObjToString(this object thisValue) + { + if (thisValue != null) return thisValue.ToString().Trim(); + return ""; + } + + /// <summary> + /// + /// </summary> + /// <param name="thisValue"></param> + /// <returns></returns> + public static bool IsNotEmptyOrNull(this object thisValue) + { + return ObjToString(thisValue) != "" && ObjToString(thisValue) != "undefined" && ObjToString(thisValue) != "null"; + } + + /// <summary> + /// + /// </summary> + /// <param name="thisValue"></param> + /// <param name="errorValue"></param> + /// <returns></returns> + public static string ObjToString(this object thisValue, string errorValue) + { + if (thisValue != null) return thisValue.ToString().Trim(); + return errorValue; + } + + public static bool IsNullOrEmpty(this object thisValue) => thisValue == null || thisValue == DBNull.Value || string.IsNullOrWhiteSpace(thisValue.ToString()); + + /// <summary> + /// + /// </summary> + /// <param name="thisValue"></param> + /// <returns></returns> + public static Decimal ObjToDecimal(this object thisValue) + { + Decimal reval = 0; + if (thisValue != null && thisValue != DBNull.Value && decimal.TryParse(thisValue.ToString(), out reval)) + { + return reval; + } + + return 0; + } + + /// <summary> + /// + /// </summary> + /// <param name="thisValue"></param> + /// <param name="errorValue"></param> + /// <returns></returns> + public static Decimal ObjToDecimal(this object thisValue, decimal errorValue) + { + Decimal reval = 0; + if (thisValue != null && thisValue != DBNull.Value && decimal.TryParse(thisValue.ToString(), out reval)) + { + return reval; + } + + return errorValue; + } + + /// <summary> + /// + /// </summary> + /// <param name="thisValue"></param> + /// <returns></returns> + public static DateTime ObjToDate(this object thisValue) + { + DateTime reval = DateTime.MinValue; + if (thisValue != null && thisValue != DBNull.Value && DateTime.TryParse(thisValue.ToString(), out reval)) + { + reval = Convert.ToDateTime(thisValue); + } + + return reval; + } + + /// <summary> + /// + /// </summary> + /// <param name="thisValue"></param> + /// <param name="errorValue"></param> + /// <returns></returns> + public static DateTime ObjToDate(this object thisValue, DateTime errorValue) + { + DateTime reval = DateTime.MinValue; + if (thisValue != null && thisValue != DBNull.Value && DateTime.TryParse(thisValue.ToString(), out reval)) + { + return reval; + } + + return errorValue; + } + + /// <summary> + /// + /// </summary> + /// <param name="thisValue"></param> + /// <returns></returns> + public static bool ObjToBool(this object thisValue) + { + bool reval = false; + if (thisValue != null && thisValue != DBNull.Value && bool.TryParse(thisValue.ToString(), out reval)) + { + return reval; + } + + return reval; + } + + + /// <summary> + /// 鑾峰彇褰撳墠鏃堕棿鐨勬椂闂存埑 + /// </summary> + /// <param name="thisValue"></param> + /// <returns></returns> + public static string DateToTimeStamp(this DateTime thisValue) + { + TimeSpan ts = thisValue - new DateTime(1970, 1, 1, 0, 0, 0, 0); + return Convert.ToInt64(ts.TotalSeconds).ToString(); + } + + public static object ChangeType(this object value, Type type) + { + if (value == null && type.IsGenericType) return Activator.CreateInstance(type); + if (value == null) return null; + if (type == value.GetType()) return value; + if (type.IsEnum) + { + if (value is string) + return Enum.Parse(type, value as string); + else + return Enum.ToObject(type, value); + } + + if (!type.IsInterface && type.IsGenericType) + { + Type innerType = type.GetGenericArguments()[0]; + object innerValue = ChangeType(value, innerType); + return Activator.CreateInstance(type, new object[] { innerValue }); + } + + if (value is string && type == typeof(Guid)) return new Guid(value as string); + if (value is string && type == typeof(Version)) return new Version(value as string); + if (!(value is IConvertible)) return value; + return Convert.ChangeType(value, type); + } + + public static object ChangeTypeList(this object value, Type type) + { + if (value == null) return default; + + var gt = typeof(List<>).MakeGenericType(type); + dynamic lis = Activator.CreateInstance(gt); + + var addMethod = gt.GetMethod("Add"); + string values = value.ToString(); + if (values != null && values.StartsWith("(") && values.EndsWith(")")) + { + string[] splits; + if (values.Contains("\",\"")) + { + splits = values.Remove(values.Length - 2, 2) + .Remove(0, 2) + .Split("\",\""); + } + else + { + splits = values.Remove(0, 1) + .Remove(values.Length - 2, 1) + .Split(","); + } + + foreach (var split in splits) + { + var str = split; + if (split.StartsWith("\"") && split.EndsWith("\"")) + { + str = split.Remove(0, 1) + .Remove(split.Length - 2, 1); + } + + addMethod.Invoke(lis, new object[] { ChangeType(str, type) }); + } + } + + return lis; + } + + public static string ToJson(this object value) + { + return JsonConvert.SerializeObject(value); + } + + public static bool IsInt(this object obj) + { + if (obj == null) + return false; + bool reslut = Int32.TryParse(obj.ToString(), out int _number); + return reslut; + + } + public static bool IsDate(this object str) + { + return str.IsDate(out _); + } + public static bool IsDate(this object str, out DateTime dateTime) + { + dateTime = DateTime.Now; + if (str == null || str.ToString() == "") + { + return false; + } + return DateTime.TryParse(str.ToString(), out dateTime); + } + + /// <summary> + /// 鏍规嵁浼犲叆鏍煎紡鍒ゆ柇鏄惁涓哄皬鏁� + /// </summary> + /// <param name="str"></param> + /// <param name="formatString">18,5</param> + /// <returns></returns> + public static bool IsNumber(this string str, string formatString) + { + if (string.IsNullOrEmpty(str)) return false; + + return Regex.IsMatch(str, @"^[+-]?\d*[.]?\d*$"); + } + + public static bool IsGuid(this string guid) + { + Guid newId; + return guid.GetGuid(out newId); + } + + public static bool GetGuid(this string guid, out Guid outId) + { + Guid emptyId = Guid.Empty; + return Guid.TryParse(guid, out outId); + } + + /// <summary> + /// 杞崲涓虹煭鏁村瀷 qy 2024-7-15 + /// </summary> + /// <param name="data">鏁版嵁</param> + public static short ToShort(this object data) + { + if (data == null) + return 0; + short result; + var success = short.TryParse(data.ToString(), out result); + if (success) + return result; + try + { + return Convert.ToInt16(data); + } + catch (Exception) + { + return 0; + } + } + + /// <summary> + /// 杞崲涓洪珮绮惧害娴偣鏁�,骞舵寜鎸囧畾鐨勫皬鏁颁綅4鑸�5鍏� qy 2024-7-15 + /// </summary> + /// <param name="data">鏁版嵁</param> + /// <param name="digits">灏忔暟浣嶆暟</param> + public static decimal ToDecimal(this object data, int digits) + { + return Math.Round(ObjToDecimal(data), digits); + } + + + + /// <summary> + /// 鏋氫妇杞琇ist qy 2024-7-15 + /// </summary> + /// <typeparam name="T"></typeparam> + /// <returns></returns> + public static List<object> GetEnumList<T>() + { + List<object> list = new List<object>(); + var t = typeof(T); + foreach (var item in Enum.GetValues(typeof(T))) + { + FieldInfo f = t.GetField(Enum.GetName(typeof(T), item)); + var r = (System.ComponentModel.DescriptionAttribute[])f.GetCustomAttributes(typeof(System.ComponentModel.DescriptionAttribute), false); + list.Add(new { ID = item, value = Enum.GetName(typeof(T), item), name = r[0].Description }); + } + return list; + } + + /// <summary> + /// 楠岃瘉鍔ㄦ�佺被鍨嬪厓绱犳槸鍚︿负绌� qy 2024-7-15 + /// </summary> + /// <param name="obj"></param> + /// <returns></returns> + public static bool CheckDynamic(object obj) + { + return (obj != null && Convert.ToString(obj) != "") ? true : false; + } + + /// <summary> + /// 鍔ㄦ�佺被鍨嬪厓绱犺浆瀛楃涓插苟瑙g爜 qy 2024-7-15 + /// </summary> + /// <param name="obj"></param> + /// <returns></returns> + public static string DynamicToString(object obj) + { + return CheckDynamic(obj) ? HttpUtility.UrlDecode(Convert.ToString(obj).Trim()) : ""; + } + + /// <summary> + /// DataTable杞负json qy 2024-7-15 + /// </summary> + /// <param name="parObjRefDataTable">DataTable</param> + /// <returns>json鏁版嵁</returns> + public static string ToJson(this DataTable parObjRefDataTable) + { + List<object> objArrList = new List<object>(); + + foreach (DataRow objDataRow in parObjRefDataTable.Rows) + { + Dictionary<string, object> objResult = new Dictionary<string, object>(); + + foreach (DataColumn objDataColumn in parObjRefDataTable.Columns) + objResult.Add(objDataColumn.ColumnName, objDataRow[objDataColumn].ToString()); + + objArrList.Add(objResult); + } + + return ToJson(objArrList); + } + /// <summary> + /// Json杞琇ist qy 2024-7-15 + /// </summary> + /// <typeparam name="T"></typeparam> + /// <param name="parJson"></param> + /// <returns></returns> + public static List<T> JsonToList<T>(this string parJson) + { + if (string.IsNullOrWhiteSpace(parJson)) + { + return new List<T>(); + } + else + { + return JsonConvert.DeserializeObject<List<T>>(parJson); + } + } + + /// <summary> + /// 鏃ユ湡杞负unix鍊� + /// </summary> + /// <param name="dt"></param> + /// <param name="utc">T:鎸塙TC鏃堕棿璁$畻(榛樿);F:鎸夋湰鍦版椂闂磋绠�</param> + /// <returns></returns> + public static double ToUnix(this DateTime dt, bool utc = true) + { + double intResult = 0; + System.DateTime startTime = TimeZone.CurrentTimeZone.ToLocalTime(new System.DateTime(1970, 1, 1)); + intResult = (dt - startTime).TotalSeconds; + intResult = Math.Round(intResult, 0); + return intResult; + } + + #region 鍒ゆ柇鏄惁涓哄瓧绗︿覆 qy 2024-7-15 + /// <summary> + /// 鍒ゆ柇瀛楃涓叉槸鍚︿负鍚堟硶鐨刯son瀛楃涓� qy 2024-7-15 + /// </summary> + /// <param name="json"></param> + /// <returns></returns> + public static bool IsJson(string json) + { + int errIndex; + return IsJson(json, out errIndex); + } + public static bool IsJson(string json, out int errIndex) + { + errIndex = 0; + if (IsJsonStart(ref json)) + { + CharState cs = new CharState(); + char c; + for (int i = 0; i < json.Length; i++) + { + c = json[i]; + if (SetCharState(c, ref cs) && cs.childrenStart)//璁剧疆鍏抽敭绗﹀彿鐘舵�併�� + { + string item = json.Substring(i); + int err; + int length = GetValueLength(item, true, out err); + cs.childrenStart = false; + if (err > 0) + { + errIndex = i + err; + return false; + } + i = i + length - 1; + } + if (cs.isError) + { + errIndex = i; + return false; + } + } + + return !cs.arrayStart && !cs.jsonStart; + } + return false; + } + + private static bool IsJsonStart(ref string json) + { + if (!string.IsNullOrEmpty(json)) + { + json = json.Trim('\r', '\n', ' '); + if (json.Length > 1) + { + char s = json[0]; + char e = json[json.Length - 1]; + return (s == '{' && e == '}') || (s == '[' && e == ']'); + } + } + return false; + } + + /// <summary> + /// 鑾峰彇鍊肩殑闀垮害锛堝綋Json鍊煎祵濂椾互"{"鎴�"["寮�澶存椂锛� qy 2024-7-15 + /// </summary> + private static int GetValueLength(string json, bool breakOnErr, out int errIndex) + { + errIndex = 0; + int len = 0; + if (!string.IsNullOrEmpty(json)) + { + CharState cs = new CharState(); + char c; + for (int i = 0; i < json.Length; i++) + { + c = json[i]; + if (!SetCharState(c, ref cs))//璁剧疆鍏抽敭绗﹀彿鐘舵�併�� + { + if (!cs.jsonStart && !cs.arrayStart)//json缁撴潫锛屽張涓嶆槸鏁扮粍锛屽垯閫�鍑恒�� + { + break; + } + } + else if (cs.childrenStart)//姝e父瀛楃锛屽�肩姸鎬佷笅銆� + { + int length = GetValueLength(json.Substring(i), breakOnErr, out errIndex);//閫掑綊瀛愬�硷紝杩斿洖涓�涓暱搴︺�傘�傘�� + cs.childrenStart = false; + cs.valueStart = 0; + //cs.state = 0; + i = i + length - 1; + } + if (breakOnErr && cs.isError) + { + errIndex = i; + return i; + } + if (!cs.jsonStart && !cs.arrayStart)//璁板綍褰撳墠缁撴潫浣嶇疆銆� + { + len = i + 1;//闀垮害姣旂储寮�+1 + break; + } + } + } + return len; + } + + /// <summary> + /// 瀛楃鐘舵�� qy 2024-7-15 + /// </summary> + private class CharState + { + internal bool jsonStart = false;//浠� "{"寮�濮嬩簡... + internal bool setDicValue = false;// 鍙互璁剧疆瀛楀吀鍊间簡銆� + internal bool escapeChar = false;//浠�"\"杞箟绗﹀彿寮�濮嬩簡 + /// <summary> + /// 鏁扮粍寮�濮嬨�愪粎绗竴寮�澶存墠绠椼�戯紝鍊煎祵濂楃殑浠ャ�恈hildrenStart銆戞潵鏍囪瘑銆� + /// </summary> + internal bool arrayStart = false;//浠�"[" 绗﹀彿寮�濮嬩簡 + internal bool childrenStart = false;//瀛愮骇宓屽寮�濮嬩簡銆� + /// <summary> + /// 銆�0 鍒濆鐘舵�侊紝鎴� 閬囧埌鈥�,鈥濋�楀彿銆戯紱銆�1 閬囧埌鈥滐細鈥濆啋鍙枫�� + /// </summary> + internal int state = 0; + + /// <summary> + /// 銆�-1 鍙栧�肩粨鏉熴�戙��0 鏈紑濮嬨�戙��1 鏃犲紩鍙峰紑濮嬨�戙��2 鍗曞紩鍙峰紑濮嬨�戙��3 鍙屽紩鍙峰紑濮嬨�� + /// </summary> + internal int keyStart = 0; + /// <summary> + /// 銆�-1 鍙栧�肩粨鏉熴�戙��0 鏈紑濮嬨�戙��1 鏃犲紩鍙峰紑濮嬨�戙��2 鍗曞紩鍙峰紑濮嬨�戙��3 鍙屽紩鍙峰紑濮嬨�� + /// </summary> + internal int valueStart = 0; + internal bool isError = false;//鏄惁璇硶閿欒銆� + + internal void CheckIsError(char c)//鍙綋鎴愪竴绾у鐞嗭紙鍥犱负GetLength浼氶�掑綊鍒版瘡涓�涓瓙椤瑰鐞嗭級 + { + if (keyStart > 1 || valueStart > 1) + { + return; + } + //绀轰緥 ["aa",{"bbbb":123,"fff","ddd"}] + switch (c) + { + case '{'://[{ "[{A}]":[{"[{B}]":3,"m":"C"}]}] + isError = jsonStart && state == 0;//閲嶅寮�濮嬮敊璇� 鍚屾椂涓嶆槸鍊煎鐞嗐�� + break; + case '}': + isError = !jsonStart || (keyStart != 0 && state == 0);//閲嶅缁撴潫閿欒 鎴栬�� 鎻愬墠缁撴潫{"aa"}銆傛甯哥殑鏈墈} + break; + case '[': + isError = arrayStart && state == 0;//閲嶅寮�濮嬮敊璇� + break; + case ']': + isError = !arrayStart || jsonStart;//閲嶅寮�濮嬮敊璇� 鎴栬�� Json 鏈粨鏉� + break; + case '"': + case '\'': + isError = !(jsonStart || arrayStart); //json 鎴栨暟缁勫紑濮嬨�� + if (!isError) + { + //閲嶅寮�濮� [""",{"" "}] + isError = (state == 0 && keyStart == -1) || (state == 1 && valueStart == -1); + } + if (!isError && arrayStart && !jsonStart && c == '\'')//['aa',{}] + { + isError = true; + } + break; + case ':': + isError = !jsonStart || state == 1;//閲嶅鍑虹幇銆� + break; + case ',': + isError = !(jsonStart || arrayStart); //json 鎴栨暟缁勫紑濮嬨�� + if (!isError) + { + if (jsonStart) + { + isError = state == 0 || (state == 1 && valueStart > 1);//閲嶅鍑虹幇銆� + } + else if (arrayStart)//["aa,] [,] [{},{}] + { + isError = keyStart == 0 && !setDicValue; + } + } + break; + case ' ': + case '\r': + case '\n'://[ "a",\r\n{} ] + case '\0': + case '\t': + break; + default: //鍊煎紑澶淬�傘�� + isError = (!jsonStart && !arrayStart) || (state == 0 && keyStart == -1) || (valueStart == -1 && state == 1);// + break; + } + //if (isError) + //{ + + //} + } + } + /// <summary> + /// 璁剧疆瀛楃鐘舵��(杩斿洖true鍒欎负鍏抽敭璇嶏紝杩斿洖false鍒欏綋涓烘櫘閫氬瓧绗﹀鐞嗭級 qy 2024-7-15 + /// </summary> + private static bool SetCharState(char c, ref CharState cs) + { + cs.CheckIsError(c); + switch (c) + { + case '{'://[{ "[{A}]":[{"[{B}]":3,"m":"C"}]}] + #region 澶ф嫭鍙� + if (cs.keyStart <= 0 && cs.valueStart <= 0) + { + cs.keyStart = 0; + cs.valueStart = 0; + if (cs.jsonStart && cs.state == 1) + { + cs.childrenStart = true; + } + else + { + cs.state = 0; + } + cs.jsonStart = true;//寮�濮嬨�� + return true; + } + #endregion + break; + case '}': + #region 澶ф嫭鍙风粨鏉� + if (cs.keyStart <= 0 && cs.valueStart < 2 && cs.jsonStart) + { + cs.jsonStart = false;//姝e父缁撴潫銆� + cs.state = 0; + cs.keyStart = 0; + cs.valueStart = 0; + cs.setDicValue = true; + return true; + } + // cs.isError = !cs.jsonStart && cs.state == 0; + #endregion + break; + case '[': + #region 涓嫭鍙峰紑濮� + if (!cs.jsonStart) + { + cs.arrayStart = true; + return true; + } + else if (cs.jsonStart && cs.state == 1) + { + cs.childrenStart = true; + return true; + } + #endregion + break; + case ']': + #region 涓嫭鍙风粨鏉� + if (cs.arrayStart && !cs.jsonStart && cs.keyStart <= 2 && cs.valueStart <= 0)//[{},333]//杩欐牱缁撴潫銆� + { + cs.keyStart = 0; + cs.valueStart = 0; + cs.arrayStart = false; + return true; + } + #endregion + break; + case '"': + case '\'': + #region 寮曞彿 + if (cs.jsonStart || cs.arrayStart) + { + if (cs.state == 0)//key闃舵,鏈夊彲鑳芥槸鏁扮粍["aa",{}] + { + if (cs.keyStart <= 0) + { + cs.keyStart = (c == '"' ? 3 : 2); + return true; + } + else if ((cs.keyStart == 2 && c == '\'') || (cs.keyStart == 3 && c == '"')) + { + if (!cs.escapeChar) + { + cs.keyStart = -1; + return true; + } + else + { + cs.escapeChar = false; + } + } + } + else if (cs.state == 1 && cs.jsonStart)//鍊奸樁娈靛繀椤绘槸Json寮�濮嬩簡銆� + { + if (cs.valueStart <= 0) + { + cs.valueStart = (c == '"' ? 3 : 2); + return true; + } + else if ((cs.valueStart == 2 && c == '\'') || (cs.valueStart == 3 && c == '"')) + { + if (!cs.escapeChar) + { + cs.valueStart = -1; + return true; + } + else + { + cs.escapeChar = false; + } + } + + } + } + #endregion + break; + case ':': + #region 鍐掑彿 + if (cs.jsonStart && cs.keyStart < 2 && cs.valueStart < 2 && cs.state == 0) + { + if (cs.keyStart == 1) + { + cs.keyStart = -1; + } + cs.state = 1; + return true; + } + // cs.isError = !cs.jsonStart || (cs.keyStart < 2 && cs.valueStart < 2 && cs.state == 1); + #endregion + break; + case ',': + #region 閫楀彿 //["aa",{aa:12,}] + + if (cs.jsonStart) + { + if (cs.keyStart < 2 && cs.valueStart < 2 && cs.state == 1) + { + cs.state = 0; + cs.keyStart = 0; + cs.valueStart = 0; + //if (cs.valueStart == 1) + //{ + // cs.valueStart = 0; + //} + cs.setDicValue = true; + return true; + } + } + else if (cs.arrayStart && cs.keyStart <= 2) + { + cs.keyStart = 0; + //if (cs.keyStart == 1) + //{ + // cs.keyStart = -1; + //} + return true; + } + #endregion + break; + case ' ': + case '\r': + case '\n'://[ "a",\r\n{} ] + case '\0': + case '\t': + if (cs.keyStart <= 0 && cs.valueStart <= 0) //cs.jsonStart && + { + return true;//璺宠繃绌烘牸銆� + } + break; + default: //鍊煎紑澶淬�傘�� + if (c == '\\') //杞箟绗﹀彿 + { + if (cs.escapeChar) + { + cs.escapeChar = false; + } + else + { + cs.escapeChar = true; + return true; + } + } + else + { + cs.escapeChar = false; + } + if (cs.jsonStart || cs.arrayStart) // Json 鎴栨暟缁勫紑濮嬩簡銆� + { + if (cs.keyStart <= 0 && cs.state == 0) + { + cs.keyStart = 1;//鏃犲紩鍙风殑 + } + else if (cs.valueStart <= 0 && cs.state == 1 && cs.jsonStart)//鍙湁Json寮�濮嬫墠鏈夊�笺�� + { + cs.valueStart = 1;//鏃犲紩鍙风殑 + } + } + break; + } + return false; + } + + #endregion + + public static LinqExpressionType GetLinqCondition(this string stringType) + { + LinqExpressionType linqExpression; + switch (stringType) + { + case HtmlElementType.Contains: + linqExpression = LinqExpressionType.In; + break; + case HtmlElementType.ThanOrEqual: + linqExpression = LinqExpressionType.ThanOrEqual; + break; + case HtmlElementType.LessOrequal: + linqExpression = LinqExpressionType.LessThanOrEqual; + break; + case HtmlElementType.GT: + linqExpression = LinqExpressionType.GreaterThan; + break; + case HtmlElementType.lt: + linqExpression = LinqExpressionType.LessThan; + break; + case HtmlElementType.like: + linqExpression = LinqExpressionType.Contains; + break; + default: + linqExpression = LinqExpressionType.Equal; + break; + } + return linqExpression; + } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/HostedService/SeedDataHostedService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/HostedService/SeedDataHostedService.cs" new file mode 100644 index 0000000..21bbef2 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/HostedService/SeedDataHostedService.cs" @@ -0,0 +1,72 @@ +锘縰sing Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using Microsoft.Extensions.Logging; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Core.Helper; +using WIDESEA_Core.Seed; + +namespace WIDESEA_Core +{ + public sealed class SeedDataHostedService : IHostedService + { + private readonly DBContext _dbContext; + private readonly ILogger<SeedDataHostedService> _logger; + private readonly string _webRootPath; + private readonly IServiceProvider _serviceProvider; + + public SeedDataHostedService( + IServiceProvider serviceProvider, + IWebHostEnvironment webHostEnvironment, + ILogger<SeedDataHostedService> logger) + { + _serviceProvider = serviceProvider; + _logger = logger; + _webRootPath = webHostEnvironment.WebRootPath; + + using var scope = _serviceProvider.CreateScope(); + + var dbContext = scope.ServiceProvider.GetService<DBContext>(); + //dbContext.Db.Aop.DataExecuting = SqlSugarAop.DataExecuting; + _dbContext = dbContext; + } + + public async Task StartAsync(CancellationToken cancellationToken) + { + _logger.LogInformation("Start Initialization Db Seed Service!"); + await DoWork(); + } + + private async Task DoWork() + { + try + { + //if (AppSettings.app("AppSettings", "SeedDBEnabled").ObjToBool() || AppSettings.app("AppSettings", "SeedDBDataEnabled").ObjToBool()) + { + // 浣跨敤 myScopedService 鎵ц浠诲姟 + + //await DBSeed.SeedAsync(_dbContext, _webRootPath); + + //澶氱鎴� 鍚屾 + //await DBSeed.TenantSeedAsync(_dbContext); + } + } + catch (Exception ex) + { + _logger.LogError(ex, "Error occured seeding the Database."); + throw; + } + } + + public Task StopAsync(CancellationToken cancellationToken) + { + _logger.LogInformation("Stop Initialization Db Seed Service!"); + return Task.CompletedTask; + } + + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/HttpContextUser/AspNetUser.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/HttpContextUser/AspNetUser.cs" new file mode 100644 index 0000000..4dc19cc --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/HttpContextUser/AspNetUser.cs" @@ -0,0 +1,199 @@ +锘縰sing Microsoft.AspNetCore.Http; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Logging; +using SqlSugar; +using System; +using System.Collections.Generic; +using System.IdentityModel.Tokens.Jwt; +using System.Linq; +using System.Security.Claims; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Core.Const; +using WIDESEA_Core.DB; +using WIDESEA_Core.Helper; +using WIDESEA_Core.Seed; + +namespace WIDESEA_Core.HttpContextUser +{ + public class AspNetUser : IUser + { + private readonly IHttpContextAccessor _accessor; + //private readonly ILogger<AspNetUser> _logger; + + public AspNetUser(IHttpContextAccessor accessor/*, ILogger<AspNetUser> logger*/) + { + _accessor = accessor; + /*_logger = logger;*/ + } + + public string UserName => UserInfo.UserName; + + //private string GetName() + //{ + // if (IsAuthenticated() && _accessor.HttpContext.User.Identity.Name.IsNotEmptyOrNull()) + // { + // return _accessor.HttpContext.User.Identity.Name; + // } + // else + // { + // if (!string.IsNullOrEmpty(GetToken())) + // { + // var getNameType = /*Permissions.IsUseIds4 ? */"name" /*: "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name"*/; + // return GetUserInfoFromToken(getNameType).FirstOrDefault().ObjToString(); + // } + // } + + // return ""; + //} + + public int UserId => GetClaimValueByType("jti").FirstOrDefault().ObjToInt(); + public long TenantId => UserInfo.TenantId; + + public int RoleId => UserInfo.RoleId; + + public string Token => "throw new NotImplementedException()"; + + public int SystemType => UserInfo.SystemType; + + public bool IsAuthenticated() + { + return _accessor.HttpContext.User.Identity.IsAuthenticated; + } + + + public string GetToken() + { + return _accessor.HttpContext?.Request?.Headers["Authorization"].ObjToString().Replace("Bearer ", ""); + } + + private UserInfo _userInfo { get; set; } + private UserInfo UserInfo + { + get + { + if (_userInfo != null) + return _userInfo; + + SqlSugarClient sqlSugarClient = new SqlSugarClient(new ConnectionConfig + { + ConfigId = MainDb.CurrentDbConnId, + DbType = MainDb.DbType, + //ConnectionString = AppSettings.app(MainDb.ConnectionString).DecryptDES(AppSecret.DB), + ConnectionString = AppSettings.app(MainDb.ConnectionString), + IsAutoCloseConnection = true + }); + + dynamic userInfo = sqlSugarClient.Queryable(MainDb.UserTableName, "x").Where(MainDb.UserId, "=", UserId).Select(GetUserInfoSelectModels()).First(); + if (userInfo != null) + { + _userInfo = new UserInfo() + { + RoleId = userInfo.Role_Id, + TenantId = userInfo.TenantId, + SystemType = userInfo.SystemType, + UserName = userInfo.UserName, + }; + return _userInfo; + } + + return new UserInfo(); + } + } + + public bool IsSuperAdmin => IsRoleIdSuperAdmin(RoleId); + + public List<Permissions> Permissions => throw new NotImplementedException(); + + public UserInfo GetCurrentUserInfo() + { + return UserInfo; + } + + public List<SelectModel> GetUserInfoSelectModels() + { + List<SelectModel> selectModels = new List<SelectModel>() + { + new() { + FieldName = MainDb.TenantId + }, + new() { + FieldName = MainDb.RoleId, + }, + new() { + FieldName = MainDb.SystemType + }, + new() { + FieldName = MainDb.UserName + } + }; + return selectModels; + } + + public List<string> GetUserInfoFromToken(string ClaimType) + { + var jwtHandler = new JwtSecurityTokenHandler(); + var token = ""; + + token = GetToken(); + // token鏍¢獙 + if (token.IsNotEmptyOrNull() && jwtHandler.CanReadToken(token)) + { + JwtSecurityToken jwtToken = jwtHandler.ReadJwtToken(token); + + return (from item in jwtToken.Claims + where item.Type == ClaimType + select item.Value).ToList(); + } + + return new List<string>() { }; + } + + //public MessageModel<string> MessageModel { get; set; } + + public IEnumerable<Claim> GetClaimsIdentity() + { + if (_accessor.HttpContext != null) + { + + var claims = _accessor.HttpContext.User.Claims.ToList(); + var headers = _accessor.HttpContext.Request.Headers; + foreach (var header in headers) + { + claims.Add(new Claim(header.Key, header.Value)); + } + return claims; + } + return ArraySegment<Claim>.Empty; + } + + public List<string> GetClaimValueByType(string ClaimType) + { + return (from item in GetClaimsIdentity() + where item.Type == ClaimType + select item.Value).ToList(); + } + + public bool IsRoleIdSuperAdmin(int roleId) + { + return roleId == 1; + } + } + + public class UserInfo + { + public long TenantId { get; set; } + + public int RoleId { get; set; } + + public int SystemType { get; set; } + + public string UserName { get; set; } + + public int UserId { get; set; } + + public string UserTrueName { get; set; } + + public string HeadImageUrl { get; set; } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/HttpContextUser/IUser.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/HttpContextUser/IUser.cs" new file mode 100644 index 0000000..0b3bbb4 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/HttpContextUser/IUser.cs" @@ -0,0 +1,56 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Security.Claims; +using System.Text; +using System.Threading.Tasks; + +namespace WIDESEA_Core.HttpContextUser +{ + public interface IUser + { + /// <summary> + /// 鍚嶇О + /// </summary> + string UserName { get; } + + /// <summary> + /// UserId + /// </summary> + int UserId { get; } + + /// <summary> + /// 绉熸埛ID + /// </summary> + long TenantId { get; } + + int RoleId { get;} + + string Token { get; } + + int SystemType { get; } + + /// <summary> + /// 鏄惁璁よ瘉 + /// </summary> + /// <returns></returns> + bool IsAuthenticated(); + + + IEnumerable<Claim> GetClaimsIdentity(); + List<string> GetClaimValueByType(string ClaimType); + + string GetToken(); + List<string> GetUserInfoFromToken(string ClaimType); + + bool IsSuperAdmin { get; } + + bool IsRoleIdSuperAdmin(int roleId); + + List<Permissions> Permissions { get; } + + UserInfo GetCurrentUserInfo(); + + //MessageModel<string> MessageModel { get; set; } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/IDependency.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/IDependency.cs" new file mode 100644 index 0000000..98e47b1 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/IDependency.cs" @@ -0,0 +1,12 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WIDESEA_Core +{ + public interface IDependency + { + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/LogHelper/LogLock.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/LogHelper/LogLock.cs" new file mode 100644 index 0000000..2366ffe --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/LogHelper/LogLock.cs" @@ -0,0 +1,93 @@ +锘縰sing log4net; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Core.Helper; + +namespace WIDESEA_Core.LogHelper +{ + public class LogLock + { + private static readonly ILog log = LogManager.GetLogger(typeof(LogLock)); + static ReaderWriterLockSlim LogWriteLock = new ReaderWriterLockSlim(); + static int WritedCount = 0; + static int FailedCount = 0; + static string _contentRoot = string.Empty; + + public LogLock(string contentPath) + { + _contentRoot = contentPath; + } + + public static void OutLogAOP(string prefix, string[] dataParas, bool IsHeader = true) + { + OutSql2LogToFile(prefix, dataParas, IsHeader); + } + + public static void OutSql2LogToFile(string prefix, string[] dataParas, bool IsHeader = true, bool isWrt = false) + { + try + { + //璁剧疆璇诲啓閿佷负鍐欏叆妯″紡鐙崰璧勬簮锛屽叾浠栧啓鍏ヨ姹傞渶瑕佺瓑寰呮湰娆″啓鍏ョ粨鏉熶箣鍚庢墠鑳界户缁啓鍏� + //娉ㄦ剰锛氶暱鏃堕棿鎸佹湁璇荤嚎绋嬮攣鎴栧啓绾跨▼閿佷細浣垮叾浠栫嚎绋嬪彂鐢熼ゥ楗� (starve)銆� 涓轰簡寰楀埌鏈�濂界殑鎬ц兘锛岄渶瑕佽�冭檻閲嶆柊鏋勯�犲簲鐢ㄧ▼搴忎互灏嗗啓璁块棶鐨勬寔缁椂闂村噺灏戝埌鏈�灏忋�� + // 浠庢�ц兘鏂归潰鑰冭檻锛岃姹傝繘鍏ュ啓鍏ユā寮忓簲璇ョ揣璺熸枃浠舵搷浣滀箣鍓嶏紝鍦ㄦ澶勮繘鍏ュ啓鍏ユā寮忎粎鏄负浜嗛檷浣庝唬鐮佸鏉傚害 + // 鍥犺繘鍏ヤ笌閫�鍑哄啓鍏ユā寮忓簲鍦ㄥ悓涓�涓猼ry finally璇彞鍧楀唴锛屾墍浠ュ湪璇锋眰杩涘叆鍐欏叆妯″紡涔嬪墠涓嶈兘瑙﹀彂寮傚父锛屽惁鍒欓噴鏀炬鏁板ぇ浜庤姹傛鏁板皢浼氳Е鍙戝紓甯� + LogWriteLock.EnterWriteLock(); + + var folderPath = Path.Combine(_contentRoot, "Log"); + if (!Directory.Exists(folderPath)) + { + Directory.CreateDirectory(folderPath); + } + //string logFilePath = Path.Combine(path, $@"{filename}.log"); + var logFilePath = FileHelper.GetAvailableFileWithPrefixOrderSize(folderPath, prefix); + + var now = DateTime.Now; + string logContent = String.Join("\r\n", dataParas); + if (IsHeader) + { + logContent = ( + "--------------------------------\r\n" + + DateTime.Now + "|\r\n" + + String.Join("\r\n", dataParas) + "\r\n" + ); + } + else + { + logContent = ( + dataParas[1] + ",\r\n" + ); + } + + //if (logContent.IsNotEmptyOrNull() && logContent.Length > 500) + //{ + // logContent = logContent.Substring(0, 500) + "\r\n"; + //} + if (isWrt) + { + System.IO.File.WriteAllText(logFilePath, logContent); + } + else + { + System.IO.File.AppendAllText(logFilePath, logContent); + } + WritedCount++; + } + catch (Exception e) + { + //Console.Write(e.Message); + FailedCount++; + } + finally + { + //閫�鍑哄啓鍏ユā寮忥紝閲婃斁璧勬簮鍗犵敤 + //娉ㄦ剰锛氫竴娆¤姹傚搴斾竴娆¢噴鏀� + // 鑻ラ噴鏀炬鏁板ぇ浜庤姹傛鏁板皢浼氳Е鍙戝紓甯竅鍐欏叆閿佸畾鏈粡淇濇寔鍗宠閲婃斁] + // 鑻ヨ姹傚鐞嗗畬鎴愬悗鏈噴鏀惧皢浼氳Е鍙戝紓甯竅姝ゆā寮忎笉涓嬪厑璁镐互閫掑綊鏂瑰紡鑾峰彇鍐欏叆閿佸畾] + LogWriteLock.ExitWriteLock(); + } + } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/LogHelper/Logger.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/LogHelper/Logger.cs" new file mode 100644 index 0000000..487c512 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/LogHelper/Logger.cs" @@ -0,0 +1,124 @@ +锘縰sing log4net; +using Microsoft.AspNetCore.Http; +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Core.DB; +using WIDESEA_Core.Helper; +using WIDESEA_Core.HttpContextUser; +using WIDESEA_Core.Seed; + +namespace WIDESEA_Core.LogHelper +{ + public class Logger + { + private static readonly ILog log = LogManager.GetLogger(typeof(Logger)); + + public static void Debug(string message) + { + + } + + public static void Debug(string message, Exception exception) + { + + } + + public static void Info(string message) + { + + } + + public static void Info(string message, Exception exception) + { + + } + + public static void Warn(string message) + { + + } + + public static void Warning(string message, Exception exception) + { + + } + + public static void Error(string message) + { + + } + + public static void Error(string message, Exception exception) + { + + } + + public static void Fatal(string message) + { + + } + + public static void Fatal(string message, Exception exception) + { + + } + + public static void WriteApiLog2DB(HttpContext context, string requestParameter, DateTime beginDate, string responseParameter, DateTime endDate, LoggerStatus loggerStatus) + { + try + { + if (context.Request.Method == "OPTIONS") return; + + if (context == null) + { + Console.WriteLine($"鏈幏鍙栧埌httpcontext淇℃伅,reqParam:{requestParameter},respParam:{responseParameter},success:{loggerStatus}"); + return; + } + + Dictionary<string, object> dic = new Dictionary<string, object> + { + {"BeginDate",beginDate }, + {"ElapsedTime",(endDate - beginDate).TotalMilliseconds.DoubleToInt() }, + {"EndDate",endDate }, + {"RequestParam",requestParameter }, + {"ResponseParam",responseParameter }, + {"Success",1 }, + {"Url",context.Request.Path.Value??"" }, + {"UserIP",context.GetUserIp() }, + {"UserName","App.User?.Name" }, + {"User_Id","0" } + + //{"BeginDate",beginDate }, + //{"ElapsedTime",(endDate - beginDate).TotalMilliseconds.ObjToInt() }, + //{"EndDate",endDate }, + //{"RequestParam",requestParameter }, + //{"ResponseParam",responseParameter }, + //{"Success",1 }, + //{"Url",context.Request.Path.Value??"" }, + //{"UserIP",context.GetUserIp() }, + //{"UserName","App.User?.Name" }, + //{"User_Id","App.User?.ID" } + }; + + + SqlSugarClient sqlSugarClient = DBContext.GetCustomDB(DBContext.GetConnectionConfig()); + sqlSugarClient.Insertable(dic).AS("Sys_Log").ExecuteCommand(); + } + catch (Exception ex) + { + + } + } + } + + public enum LoggerStatus + { + Success = 1, + Error = 2, + Info = 3 + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Middlewares/ApiLogMiddleware.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Middlewares/ApiLogMiddleware.cs" new file mode 100644 index 0000000..ee5aea4 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Middlewares/ApiLogMiddleware.cs" @@ -0,0 +1,113 @@ +锘縰sing Microsoft.AspNetCore.Http; +using Microsoft.Extensions.Logging; +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Core.Helper; +using WIDESEA_Core.LogHelper; + +namespace WIDESEA_Core.Middlewares +{ + /// <summary> + /// 璁板綍璇锋眰鍜屽搷搴旀暟鎹� + /// </summary> + public class ApiLogMiddleware + { + /// <summary> + /// + /// </summary> + private readonly RequestDelegate _next; + private readonly ILogger<ApiLogMiddleware> _logger; + + public ApiLogMiddleware(RequestDelegate next, ILogger<ApiLogMiddleware> logger) + { + _next = next; + _logger = logger; + } + + //todo + public async Task InvokeAsync(HttpContext context) + { + //if (AppSettings.app("Middleware", "RequestResponseLog", "Enabled").ObjToBool()) + { + // 杩囨护锛屽彧鏈夋帴鍙� + if (context.Request.Path.Value.Contains("api")) + { + context.Request.EnableBuffering(); + //Stream originalBody = context.Response.Body; + + try + { + // 瀛樺偍璇锋眰鏁版嵁 + //string requestParam = GetRequestData(context); + //DateTime beginDate = DateTime.Now; + + //using var ms = new MemoryStream(); + //context.Response.Body = ms; + + await _next(context); + + // 瀛樺偍鍝嶅簲鏁版嵁 + //DateTime endDate = DateTime.Now; + //string responseParam = GetResponsetData(context); + + //context.Response.Body.Position = 0; + //await context.Response.Body.CopyToAsync(originalBody); + + //Logger.WriteApiLog2DB(context,requestParam, beginDate, responseParam, endDate, context.Response.StatusCode == 200 ? LoggerStatus.Success : LoggerStatus.Error); + } + catch (Exception ex) + { + // 璁板綍寮傚父 + _logger.LogError(ex.Message + "" + ex.InnerException); + } + finally + { + //context.Response.Body = originalBody; + } + } + //else + //{ + // await _next(context); + //} + } + //else + //{ + // await _next(context); + //} + } + + private string GetRequestData(HttpContext context) + { + try + { + using StreamReader sr = new StreamReader(context.Request.Body); + string request = JsonConvert.SerializeObject(sr.ReadToEnd()); ; + context.Request.Body.Position = 0; + return request; + } + catch (Exception ex) + { + return $"璇锋眰鍙傛暟鑾峰彇閿欒,{ex.Message}"; + } + } + + private string GetResponsetData(HttpContext context) + { + try + { + using StreamReader sr = new StreamReader(context.Response.Body); + string response = JsonConvert.SerializeObject(sr.ReadToEnd()); ; + context.Response.Body.Position = 0; + return response; + } + catch (Exception ex) + { + return $"鍝嶅簲鍙傛暟鑾峰彇閿欒,{ex.Message}"; + } + } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Middlewares/ExceptionHandlerMiddleware.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Middlewares/ExceptionHandlerMiddleware.cs" new file mode 100644 index 0000000..33d8e0d --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Middlewares/ExceptionHandlerMiddleware.cs" @@ -0,0 +1,59 @@ +锘縰sing Microsoft.AspNetCore.Http; +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.DirectoryServices.Protocols; +using System.Linq; +using System.Net; +using System.Text; +using System.Threading.Tasks; + +namespace WIDESEA_Core.Middlewares +{ + public class ExceptionHandlerMiddleware + { + private readonly RequestDelegate _next; + + public ExceptionHandlerMiddleware(RequestDelegate next) + { + _next = next; + } + + public async Task Invoke(HttpContext context) + { + try + { + await _next(context); + } + catch (Exception ex) + { + await HandleExceptionAsync(context, ex); + } + } + + private async Task HandleExceptionAsync(HttpContext context, Exception e) + { + if (e == null) return; + + await WriteExceptionAsync(context, e).ConfigureAwait(false); + } + + private static async Task WriteExceptionAsync(HttpContext context, Exception e) + { + var message = e.Message; + switch (e) + { + case UnauthorizedAccessException: + context.Response.StatusCode = (int)HttpStatusCode.Unauthorized; + break; + default: + context.Response.StatusCode = (int)HttpStatusCode.InternalServerError; + break; + } + context.Response.ContentType = "application/json"; + await context.Response + .WriteAsync(JsonConvert.SerializeObject(WebResponseContent.Instance.Error(message))) + .ConfigureAwait(false); + } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Middlewares/IpLimitMiddleware.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Middlewares/IpLimitMiddleware.cs" new file mode 100644 index 0000000..79a266c --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Middlewares/IpLimitMiddleware.cs" @@ -0,0 +1,41 @@ +锘縰sing log4net; +using Microsoft.AspNetCore.Builder; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Core.Helper; + +namespace WIDESEA_Core.Middlewares +{ + /// <summary> + /// ip 闄愭祦 + /// </summary> + public static class IpLimitMiddleware + { + private static readonly ILog Log = LogManager.GetLogger(typeof(IpLimitMiddleware)); + /// <summary> + /// ip闄愭祦 + /// </summary> + /// <param name="app"></param> + /// <exception cref="ArgumentNullException"></exception> + public static void UseIpLimitMiddle(this IApplicationBuilder app) + { + if (app == null) throw new ArgumentNullException(nameof(app)); + + //try + //{ + // if (AppSettings.app("Middleware", "IpRateLimit", "Enabled").ObjToBool()) + // { + // app.UseIpRateLimiting(); + // } + //} + //catch (Exception e) + //{ + // Log.Error($"Error occured limiting ip rate.\n{e.Message}"); + // throw; + //} + } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Middlewares/JwtTokenAuthMiddleware.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Middlewares/JwtTokenAuthMiddleware.cs" new file mode 100644 index 0000000..ef95892 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Middlewares/JwtTokenAuthMiddleware.cs" @@ -0,0 +1,94 @@ +锘縰sing Microsoft.AspNetCore.Http; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Core.Authorization; +using WIDESEA_Core.HttpContextUser; + +namespace WIDESEA_Core.Middlewares +{ + /// <summary> + /// 涓棿浠� + /// 鍘熷仛涓鸿嚜瀹氫箟鎺堟潈涓棿浠� + /// 鍏堝仛妫�鏌� header token鐨勪娇鐢� + /// </summary> + public class JwtTokenAuthMiddleware + { + /// <summary> + /// + /// </summary> + private readonly RequestDelegate _next; + /// <summary> + /// + /// </summary> + /// <param name="next"></param> + public JwtTokenAuthMiddleware(RequestDelegate next) + { + _next = next; + } + + + private void PreProceed(HttpContext next) + { + //Console.WriteLine($"{DateTime.Now} middleware invoke preproceed"); + //... + } + private void PostProceed(HttpContext next) + { + //Console.WriteLine($"{DateTime.Now} middleware invoke postproceed"); + //.... + } + + /// <summary> + /// + /// </summary> + /// <param name="httpContext"></param> + /// <returns></returns> + public Task Invoke(HttpContext httpContext) + { + PreProceed(httpContext); + + + //妫�娴嬫槸鍚﹀寘鍚�'Authorization'璇锋眰澶� + if (!httpContext.Request.Headers.ContainsKey("Authorization")) + { + PostProceed(httpContext); + + return _next(httpContext); + } + //var tokenHeader = httpContext.Request.Headers["Authorization"].ToString(); + var tokenHeader = httpContext.Request.Headers["Authorization"].ToString().Replace("Bearer ", ""); + + try + { + if (tokenHeader.Length >= 128) + { + //Console.WriteLine($"{DateTime.Now} token :{tokenHeader}"); + UserInfo tm = JwtHelper.SerializeJwt(tokenHeader); + + //鎺堟潈 + //var claimList = new List<Claim>(); + //var claim = new Claim(ClaimTypes.Role, tm.Role); + //claimList.Add(claim); + //var identity = new ClaimsIdentity(claimList); + //var principal = new ClaimsPrincipal(identity); + //httpContext.User = principal; + } + + } + catch (Exception e) + { + Console.WriteLine($"{DateTime.Now} middleware wrong:{e.Message}"); + } + + + PostProceed(httpContext); + + + return _next(httpContext); + } + + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Middlewares/MiddlewareHelpers.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Middlewares/MiddlewareHelpers.cs" new file mode 100644 index 0000000..917faa5 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Middlewares/MiddlewareHelpers.cs" @@ -0,0 +1,42 @@ +锘縰sing Microsoft.AspNetCore.Builder; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WIDESEA_Core.Middlewares +{ + public static class MiddlewareHelpers + { + /// <summary> + /// 璇锋眰鍝嶅簲涓棿浠� + /// </summary> + /// <param name="app"></param> + /// <returns></returns> + public static IApplicationBuilder UseApiLogMiddleware(this IApplicationBuilder app) + { + return app.UseMiddleware<ApiLogMiddleware>(); + } + + /// <summary> + /// 鑷畾涔夋巿鏉冧腑闂翠欢 + /// </summary> + /// <param name="app"></param> + /// <returns></returns> + public static IApplicationBuilder UseJwtTokenAuth(this IApplicationBuilder app) + { + return app.UseMiddleware<JwtTokenAuthMiddleware>(); + } + + /// <summary> + /// 寮傚父澶勭悊涓棿浠� + /// </summary> + /// <param name="app"></param> + /// <returns></returns> + public static IApplicationBuilder UseExceptionHandlerMiddle(this IApplicationBuilder app) + { + return app.UseMiddleware<ExceptionHandlerMiddleware>(); + } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Middlewares/SwaggerAuthMiddleware.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Middlewares/SwaggerAuthMiddleware.cs" new file mode 100644 index 0000000..feba460 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Middlewares/SwaggerAuthMiddleware.cs" @@ -0,0 +1,80 @@ +锘縰sing Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Http; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net; +using System.Text; +using System.Threading.Tasks; + +namespace WIDESEA_Core.Middlewares +{ + public class SwaggerAuthMiddleware + { + + private readonly RequestDelegate next; + + public SwaggerAuthMiddleware(RequestDelegate next) + { + this.next = next; + } + + public async Task InvokeAsync(HttpContext context) + { + // 涔熷彲浠ユ牴鎹槸鍚︽槸鏈湴鍋氬垽鏂� IsLocalRequest + if (context.Request.Path.Value.ToLower().Contains("index.html")) + { + // 鍒ゆ柇鏉冮檺鏄惁姝g‘ + if (IsAuthorized(context)) + { + await next.Invoke(context); + return; + } + + // 鏃犳潈闄愶紝璺宠浆swagger鐧诲綍椤� + context.Response.Redirect("/swg-login.html"); + } + else + { + await next.Invoke(context); + } + } + + public bool IsAuthorized(HttpContext context) + { + // 浣跨敤session妯″紡 + // 鍙互浣跨敤鍏朵粬鐨� + return context.Session.GetString("swagger-code") == "success"; + } + + /// <summary> + /// 鍒ゆ柇鏄笉鏄湰鍦拌闂� + /// 鏈湴涓嶇敤swagger鎷︽埅 + /// </summary> + /// <param name="context"></param> + /// <returns></returns> + public bool IsLocalRequest(HttpContext context) + { + if (context.Connection.RemoteIpAddress == null && context.Connection.LocalIpAddress == null) + { + return true; + } + if (context.Connection.RemoteIpAddress.Equals(context.Connection.LocalIpAddress)) + { + return true; + } + if (IPAddress.IsLoopback(context.Connection.RemoteIpAddress)) + { + return true; + } + return false; + } + } + public static class SwaggerAuthorizeExtensions + { + public static IApplicationBuilder UseSwaggerAuthorized(this IApplicationBuilder builder) + { + return builder.UseMiddleware<SwaggerAuthMiddleware>(); + } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Middlewares/SwaggerMiddleware.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Middlewares/SwaggerMiddleware.cs" new file mode 100644 index 0000000..08baad0 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Middlewares/SwaggerMiddleware.cs" @@ -0,0 +1,59 @@ +锘縰sing log4net; +using Microsoft.AspNetCore.Builder; +using Swashbuckle.AspNetCore.SwaggerUI; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Core.Helper; +using static WIDESEA_Core.Extensions.CustomApiVersion; + +namespace WIDESEA_Core.Middlewares +{ + /// <summary> + /// Swagger涓棿浠� + /// </summary> + public static class SwaggerMiddleware + { + private static readonly ILog Log = LogManager.GetLogger(typeof(SwaggerMiddleware)); + public static void UseSwaggerMiddle(this IApplicationBuilder app, Func<Stream> streamHtml) + { + if (app == null) throw new ArgumentNullException(nameof(app)); + + app.UseSwagger(); + app.UseSwaggerUI(c => + { + //鏍规嵁鐗堟湰鍚嶇О鍊掑簭 閬嶅巻灞曠ず + var apiName = AppSettings.app(new string[] { "ApiName" }); + typeof(ApiVersions).GetEnumNames().OrderByDescending(e => e).ToList().ForEach(version => + { + c.SwaggerEndpoint($"/swagger/{version}/swagger.json", $"{apiName} {version}"); + }); + + //c.SwaggerEndpoint("/swagger/v1/swagger.json", "WIDESEA.Core鍚庡彴Api"); + + //c.SwaggerEndpoint($"https://petstore.swagger.io/v2/swagger.json", $"{apiName} pet"); + + // 灏唖wagger棣栭〉锛岃缃垚鎴戜滑鑷畾涔夌殑椤甸潰锛岃寰楄繖涓瓧绗︿覆鐨勫啓娉曪細{椤圭洰鍚�.index.html} + if (streamHtml.Invoke() == null) + { + var msg = "index.html鐨勫睘鎬э紝蹇呴』璁剧疆涓哄祵鍏ョ殑璧勬簮"; + //Log.Error(msg); + throw new Exception(msg); + } + c.IndexStream = streamHtml; + c.DocExpansion(DocExpansion.None); //->淇敼鐣岄潰鎵撳紑鏃惰嚜鍔ㄦ姌鍙� + + //if (Permissions.IsUseIds4) + //{ + // c.OAuthClientId("blogadminjs"); + //} + + + // 璺緞閰嶇疆锛岃缃负绌猴紝琛ㄧず鐩存帴鍦ㄦ牴鍩熷悕锛坙ocalhost:8001锛夎闂鏂囦欢,娉ㄦ剰localhost:8001/swagger鏄闂笉鍒扮殑锛屽幓launchSettings.json鎶妉aunchUrl鍘绘帀锛屽鏋滀綘鎯虫崲涓�涓矾寰勶紝鐩存帴鍐欏悕瀛楀嵆鍙紝姣斿鐩存帴鍐檆.RoutePrefix = "doc"; + c.RoutePrefix = ""; + }); + } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Seed/DBContext.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Seed/DBContext.cs" new file mode 100644 index 0000000..a3fda65 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Seed/DBContext.cs" @@ -0,0 +1,217 @@ +锘縰sing SqlSugar; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Core.Const; +using WIDESEA_Core.DB; +using WIDESEA_Core.Helper; + +namespace WIDESEA_Core.Seed +{ + public class DBContext + { + private static MutiDBOperate connectObject => GetMainConnectionDb(); + private static string _connectionString = connectObject.Connection; + private static DbType _dbType = (DbType)connectObject.DbType; + public static string ConnId = connectObject.ConnId; + private SqlSugarClient _db; + + /// <summary> + /// 杩炴帴瀛楃涓� + /// </summary> + public static MutiDBOperate GetMainConnectionDb() + { + MutiDBOperate mainDb = new MutiDBOperate() + { + //Connection = AppSettings.app(MainDb.ConnectionString).DecryptDES(AppSecret.DB), + Connection = AppSettings.app(MainDb.ConnectionString), + ConnId = MainDb.CurrentDbConnId, + DbType = DataBaseType.SqlServer + }; + + return mainDb; + } + /// <summary> + /// 杩炴帴瀛楃涓� + /// </summary> + public static string ConnectionString + { + get { return _connectionString; } + set { _connectionString = value; } + } + /// <summary> + /// 鏁版嵁搴撶被鍨� + /// </summary> + public static DbType DbType + { + get { return _dbType; } + set { _dbType = value; } + } + /// <summary> + /// 鏁版嵁杩炴帴瀵硅薄 + /// </summary> + public SqlSugarClient Db + { + get { return _db; } + private set { _db = value; } + } + + //public SqlSugarScope DbClient + //{ + // get { return _dbClient; } + // private set { _dbClient = value; } + //} + + /// <summary> + /// 鍔熻兘鎻忚堪:鏋勯�犲嚱鏁� + /// </summary> + public DBContext(ISqlSugarClient sqlSugarClient) + { + if (string.IsNullOrEmpty(_connectionString)) + throw new ArgumentNullException("鏁版嵁搴撹繛鎺ュ瓧绗︿覆涓虹┖"); + + _db = sqlSugarClient as SqlSugarClient; + //_db.Aop.DataExecuting = SqlSugarAop.DataExecuting; + } + + #region 瀹炰緥鏂规硶 + /// <summary> + /// 鍔熻兘鎻忚堪:鑾峰彇鏁版嵁搴撳鐞嗗璞� + /// </summary> + /// <returns>杩斿洖鍊�</returns> + public SimpleClient<T> GetEntityDB<T>() where T : class, new() + { + return new SimpleClient<T>(_db); + } + /// <summary> + /// 鍔熻兘鎻忚堪:鑾峰彇鏁版嵁搴撳鐞嗗璞� + /// </summary> + /// <param name="db">db</param> + /// <returns>杩斿洖鍊�</returns> + //public SimpleClient<T> GetEntityDB<T>(SqlSugarClient db) where T : class, new() + //{ + // return new SimpleClient<T>(db); + //} + + + + #endregion + + + #region 鏍规嵁瀹炰綋绫荤敓鎴愭暟鎹簱琛� + /// <summary> + /// 鍔熻兘鎻忚堪:鏍规嵁瀹炰綋绫荤敓鎴愭暟鎹簱琛� + /// </summary> + /// <param name="blnBackupTable">鏄惁澶囦唤琛�</param> + /// <param name="lstEntitys">鎸囧畾鐨勫疄浣�</param> + public void CreateTableByEntity<T>(bool blnBackupTable, params T[] lstEntitys) where T : class, new() + { + Type[] lstTypes = null; + if (lstEntitys != null) + { + lstTypes = new Type[lstEntitys.Length]; + for (int i = 0; i < lstEntitys.Length; i++) + { + T t = lstEntitys[i]; + lstTypes[i] = typeof(T); + } + } + CreateTableByEntity(blnBackupTable, lstTypes); + } + + /// <summary> + /// 鍔熻兘鎻忚堪:鏍规嵁瀹炰綋绫荤敓鎴愭暟鎹簱琛� + /// </summary> + /// <param name="blnBackupTable">鏄惁澶囦唤琛�</param> + /// <param name="lstEntitys">鎸囧畾鐨勫疄浣�</param> + public void CreateTableByEntity(bool blnBackupTable, params Type[] lstEntitys) + { + if (blnBackupTable) + { + _db.CodeFirst.BackupTable().InitTables(lstEntitys); //change entity backupTable + } + else + { + _db.CodeFirst.InitTables(lstEntitys); + } + } + #endregion + + + #region 闈欐�佹柟娉� + + ///// <summary> + ///// 鍔熻兘鎻忚堪:鑾峰緱涓�涓狣bContext + ///// </summary> + ///// <returns></returns> + //public static MyContext GetDbContext() + //{ + // return new MyContext(); + //} + + /// <summary> + /// 鍔熻兘鎻忚堪:璁剧疆鍒濆鍖栧弬鏁� + /// </summary> + /// <param name="strConnectionString">杩炴帴瀛楃涓�</param> + /// <param name="enmDbType">鏁版嵁搴撶被鍨�</param> + public static void Init(string strConnectionString, DbType enmDbType = SqlSugar.DbType.SqlServer) + { + _connectionString = strConnectionString; + _dbType = enmDbType; + } + + /// <summary> + /// 鍔熻兘鎻忚堪:鍒涘缓涓�涓摼鎺ラ厤缃� + /// </summary> + /// <param name="blnIsAutoCloseConnection">鏄惁鑷姩鍏抽棴杩炴帴</param> + /// <param name="blnIsShardSameThread">鏄惁澶哥被浜嬪姟</param> + /// <returns>ConnectionConfig</returns> + public static ConnectionConfig GetConnectionConfig(bool blnIsAutoCloseConnection = true, bool blnIsShardSameThread = false) + { + ConnectionConfig config = new ConnectionConfig() + { + ConnectionString = _connectionString, + DbType = _dbType, + IsAutoCloseConnection = blnIsAutoCloseConnection, + ConfigureExternalServices = new ConfigureExternalServices() + { + //DataInfoCacheService = new HttpRuntimeCache() + }, + //IsShardSameThread = blnIsShardSameThread + }; + return config; + } + + /// <summary> + /// 鍔熻兘鎻忚堪:鑾峰彇涓�涓嚜瀹氫箟鐨凞B + /// </summary> + /// <param name="config">config</param> + /// <returns>杩斿洖鍊�</returns> + public static SqlSugarClient GetCustomDB(ConnectionConfig config) + { + return new SqlSugarClient(config); + } + /// <summary> + /// 鍔熻兘鎻忚堪:鑾峰彇涓�涓嚜瀹氫箟鐨勬暟鎹簱澶勭悊瀵硅薄 + /// </summary> + /// <param name="sugarClient">sugarClient</param> + /// <returns>杩斿洖鍊�</returns> + public static SimpleClient<T> GetCustomEntityDB<T>(SqlSugarClient sugarClient) where T : class, new() + { + return new SimpleClient<T>(sugarClient); + } + /// <summary> + /// 鍔熻兘鎻忚堪:鑾峰彇涓�涓嚜瀹氫箟鐨勬暟鎹簱澶勭悊瀵硅薄 + /// </summary> + /// <param name="config">config</param> + /// <returns>杩斿洖鍊�</returns> + public static SimpleClient<T> GetCustomEntityDB<T>(ConnectionConfig config) where T : class, new() + { + SqlSugarClient sugarClient = GetCustomDB(config); + return GetCustomEntityDB<T>(sugarClient); + } + #endregion + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Seed/DBSeed.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Seed/DBSeed.cs" new file mode 100644 index 0000000..1d1903e --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Seed/DBSeed.cs" @@ -0,0 +1,320 @@ +锘縰sing Castle.Components.DictionaryAdapter.Xml; +using Microsoft.AspNetCore.Mvc.Rendering; +using Newtonsoft.Json; +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Dynamic; +using System.Linq; +using System.Net.Sockets; +using System.Reflection; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Core.Const; +using WIDESEA_Core.DB; +using WIDESEA_Core.Helper; +using WIDESEA_Core.Tenants; + +namespace WIDESEA_Core.Seed +{ + public class DBSeed + { + private static string SeedDataFolder = "WIDESEAWCS_DB.DBSeed.Json/{0}.tsv"; + + /// <summary> + /// 寮傛娣诲姞绉嶅瓙鏁版嵁 + /// </summary> + /// <param name="myContext"></param> + /// <param name="WebRootPath"></param> + /// <returns></returns> + public static async Task SeedAsync(DBContext dbContext, string WebRootPath) + { + try + { + if (string.IsNullOrEmpty(WebRootPath)) + { + throw new Exception("鑾峰彇wwwroot璺緞鏃讹紝寮傚父锛�"); + } + + SeedDataFolder = Path.Combine(WebRootPath, SeedDataFolder); + + Console.WriteLine("************ WIDESEA DataBase Set *****************"); + + //Console.WriteLine($"Master DB ConId: {DBContext.ConnId}"); + Console.WriteLine($"Master DB Type: {DBContext.DbType}"); + //Console.WriteLine($"Master DB ConnectString: {DBContext.ConnectionString}"); + + Console.WriteLine(); + + // 鍒涘缓鏁版嵁搴� + Console.WriteLine($"Create Database(The Db Id:{DBContext.ConnId})..."); + + if (DBContext.DbType != SqlSugar.DbType.Oracle) + { + dbContext.Db.DbMaintenance.CreateDatabase(); + ConsoleHelper.WriteSuccessLine($"Database Created Successfully!"); + } + else + { + //Oracle 鏁版嵁搴撲笉鏀寔璇ユ搷浣� + ConsoleHelper.WriteSuccessLine($"Oracle 鏁版嵁搴撲笉鏀寔璇ユ搷浣滐紝鍙墜鍔ㄥ垱寤篛racle鏁版嵁搴�!"); + } + + // 鍒涘缓鏁版嵁搴撹〃锛岄亶鍘嗘寚瀹氬懡鍚嶇┖闂翠笅鐨刢lass锛� + // 娉ㄦ剰涓嶈鎶婂叾浠栧懡鍚嶇┖闂翠笅鐨勪篃娣诲姞杩涙潵銆� + Console.WriteLine("Create Tables..."); + + var path = AppDomain.CurrentDomain.RelativeSearchPath ?? AppDomain.CurrentDomain.BaseDirectory; + var referencedAssemblies = System.IO.Directory.GetFiles(path, MainDb.AssemblyName).Select(Assembly.LoadFrom).ToArray(); + + var modelTypes = referencedAssemblies + .SelectMany(a => a.DefinedTypes) + .Select(type => type.AsType()) + .Where(x => x.IsClass && x.Namespace is MainDb.EntityNameSpace && x.GetCustomAttribute<SugarTable>() != null) + .ToList(); + + modelTypes.ForEach(t => + { + //var diffString = dbContext.Db.CodeFirst.GetDifferenceTables(t).ToDiffString(); + // 杩欓噷鍙敮鎸佹坊鍔犺〃锛屼笉鏀寔鍒犻櫎 + // 濡傛灉鎯宠鍒犻櫎锛屾暟鎹簱鐩存帴鍙抽敭鍒犻櫎锛屾垨鑰呰仈绯籗qlSugar浣滆�咃紱 + IDbMaintenance dbMaintenance = dbContext.Db.DbMaintenance; + if (!dbMaintenance.IsAnyTable(t.Name, false)) + { + ConsoleHelper.WriteSuccessLine($"Table [{t.Name}] Created Successfully"); + dbContext.Db.CodeFirst.InitTables(t); + + string seedData = FileHelper.ReadFile(string.Format(SeedDataFolder, t.Name), Encoding.UTF8); + + #region AddSeedData + if (seedData != "涓嶅瓨鍦ㄧ浉搴旂殑鐩綍") + { + List<Dictionary<string, object>> dicFile = JsonConvert.DeserializeObject<List<Dictionary<string, object>>>(seedData); + + if (dicFile.Count > 0) + { + List<Dictionary<string, object>> dic = new List<Dictionary<string, object>>(); + + List<string> columnNames = dbContext.Db.DbMaintenance.GetColumnInfosByTableName(t.Name, false).Select(x => x.DbColumnName).ToList(); + var a = t.GetProperties().FirstOrDefault(x => !columnNames.Contains(x.Name)); + + List<PropertyInfo> propertyInfos = t.GetProperties().Where(x => columnNames.Contains(x.Name)).ToList(); + for (int j = 0; j < dicFile.Count; j++) + { + Dictionary<string, object> keyValuePairs = new Dictionary<string, object>(); + for (int i = 0; i < propertyInfos.Count; i++) + { + PropertyInfo propertyInfo = propertyInfos[i]; + SugarColumn sugarColumn = propertyInfo.GetCustomAttribute<SugarColumn>(); + if (sugarColumn != null) + { + if (!sugarColumn.IsIgnore) + { + keyValuePairs.Add(propertyInfo.Name, dicFile[j][propertyInfo.Name]); + } + } + } + dic.Add(keyValuePairs); + } + + if (dic.Count > 0) + { + for (int i = 0; i < dic.Count; i++) + { + if (dic[i].ContainsKey("CreateDate")) + dic[i]["CreateDate"] = DateTime.Now; + else + dic[i].Add("CreateDate", DateTime.Now); + } + string str = $"SET IDENTITY_INSERT {t.Name} ON;"; + + str += dbContext.Db.Insertable(dic).AS(t.Name).ToSqlString(); + + str += ($"SET IDENTITY_INSERT {t.Name} OFF;"); + + dbContext.Db.Ado.ExecuteCommand(str); + + ConsoleHelper.WriteSuccessLine($"Table [{t.Name}] SeedData Added Successfully"); + } + } + } + #endregion + } + else + { + List<string> columnNames = dbContext.Db.DbMaintenance.GetColumnInfosByTableName(t.Name, false).Select(x => x.DbColumnName).ToList(); + if (t.GetProperties().FirstOrDefault(x => !columnNames.Contains(x.Name)) != null) + { + bool isChange = true; + List<PropertyInfo> propertyInfos = t.GetProperties().Where(x => !columnNames.Contains(x.Name)).ToList(); + for (int i = 0; i < propertyInfos.Count; i++) + { + PropertyInfo propertyInfo = propertyInfos[i]; + SugarColumn sugarColumn = propertyInfo.GetCustomAttribute<SugarColumn>(); + if (sugarColumn != null) + { + if (!sugarColumn.IsIgnore) + { + if (!sugarColumn.IsNullable) + { + isChange = false; + break; + } + } + } + } + if (isChange) + dbContext.Db.CodeFirst.InitTables(t); + } + } + }); + ConsoleHelper.WriteSuccessLine($"Tables Created Successfully!"); + Console.WriteLine(); + + + } + catch (Exception ex) + { + // 1銆佽嫢鏄疢ysql,鏌ョ湅甯歌闂:https://github.com/anjoy8/Blog.Core/issues/148#issue-776281770 + //2銆佽嫢鏄疧racle,鏌ョ湅甯歌闂:https://github.com/anjoy8/Blog.Core/issues/148#issuecomment-752340231 + throw new Exception("閿欒锛�" + ex.Message); + } + } + + /// <summary> + /// 鍒濆鍖� 澶氱鎴� + /// </summary> + /// <param name="dbContext"></param> + /// <returns></returns> + public static async Task TenantSeedAsync(DBContext dbContext) + { + + if (BaseDBConfig.MutiConnectionString.Where(x => x.ConnId != MainDb.CurrentDbConnId).Any()) + { + Console.WriteLine($@"Init Multi Tenant Db"); + foreach (MutiDBOperate tenant in BaseDBConfig.MutiConnectionString.Where(x => x.ConnId != MainDb.CurrentDbConnId)) + { + + Console.WriteLine($@"Init Multi Tenant Db : {tenant.ConnId}"); + ConnectionConfig connectionConfig = new ConnectionConfig() + { + ConfigId = tenant.ConnId, + ConnectionString = tenant.Connection, + IsAutoCloseConnection = true, + MoreSettings = new ConnMoreSettings() + { + IsAutoRemoveDataCache = true + }, + DbType = (DbType)tenant.DbType, + }; + await InitTenantSeedAsync(dbContext.Db.AsTenant(), connectionConfig); + } + + Console.WriteLine(DateTime.Now + $@"Init Multi Tenant Db Finish"); + } + + //tenants = await myContext.Db.Queryable<SysTenant>().Where(s => s.TenantType == TenantTypeEnum.Tables).ToListAsync(); + //if (tenants.Any()) + //{ + // await InitTenantSeedAsync(myContext, tenants); + //} + } + + #region 澶氱鎴� 澶氬簱 鍒濆鍖� + + /// <summary> + /// 鍒濆鍖栧搴� + /// </summary> + /// <param name="itenant"></param> + /// <param name="config"></param> + /// <returns></returns> + public static async Task InitTenantSeedAsync(ITenant itenant, ConnectionConfig config) + { + Console.WriteLine(DateTime.Now + $@"Init Multi Tenant Db"); + //itenant.RemoveConnection(config.ConfigId); + itenant.AddConnection(config); + + var db = itenant.GetConnectionScope(config.ConfigId); + + db.DbMaintenance.CreateDatabase(); + ConsoleHelper.WriteSuccessLine($"Init Multi Tenant Db : {config.ConfigId} Database created successfully!"); + + Console.WriteLine($@"Init Multi Tenant Db : {config.ConfigId} Create Tables"); + + // 鑾峰彇鎵�鏈夊疄浣撹〃-鍒濆鍖栫鎴蜂笟鍔¤〃 + var entityTypes = TenantUtil.GetTenantEntityTypes(TenantTypeEnum.Db); + if (!entityTypes.Any()) return; + foreach (var entityType in entityTypes) + { + //var splitTable = entityType.GetCustomAttribute<SplitTableAttribute>(); + //if (splitTable == null) + db.CodeFirst.InitTables(entityType); + //else + // db.CodeFirst.SplitTables().InitTables(entityType); + + Console.WriteLine(entityType.Name); + } + Console.WriteLine(DateTime.Now + $@"Init Multi Tenant Db Finish"); + //澶氱鎴峰垵濮嬪寲绉嶅瓙鏁版嵁 + //await TenantSeedDataAsync(db, TenantTypeEnum.Db); + } + + #endregion + + //private static async Task TenantSeedDataAsync(ISqlSugarClient db, TenantTypeEnum tenantType) + //{ + // // 鑾峰彇鎵�鏈夌瀛愰厤缃�-鍒濆鍖栨暟鎹� + // var seedDataTypes = AssemblysExtensions.GetAllAssemblies().SelectMany(s => s.DefinedTypes) + // .Where(u => !u.IsInterface && !u.IsAbstract && u.IsClass) + // .Where(u => + // { + // var esd = u.GetInterfaces().FirstOrDefault(i => i.HasImplementedRawGeneric(typeof(IEntitySeedData<>))); + // if (esd is null) + // { + // return false; + // } + + // var eType = esd.GenericTypeArguments[0]; + // return eType.IsTenantEntity(tenantType); + // }); + // if (!seedDataTypes.Any()) return; + // foreach (var seedType in seedDataTypes) + // { + // dynamic instance = Activator.CreateInstance(seedType); + // //鍒濆鍖栨暟鎹� + // { + // var seedData = instance.InitSeedData(); + // if (seedData != null && Enumerable.Any(seedData)) + // { + // var entityType = seedType.GetInterfaces().First().GetGenericArguments().First(); + // var entity = db.EntityMaintenance.GetEntityInfo(entityType); + + // if (!await db.Queryable(entity.DbTableName, "").AnyAsync()) + // { + // await db.Insertable(Enumerable.ToList(seedData)).ExecuteCommandAsync(); + // Console.WriteLine($"Table:{entity.DbTableName} init success!"); + // } + // } + // } + + // //绉嶅瓙鏁版嵁 + // { + // var seedData = instance.SeedData(); + // if (seedData != null && Enumerable.Any(seedData)) + // { + // var entityType = seedType.GetInterfaces().First().GetGenericArguments().First(); + // var entity = db.EntityMaintenance.GetEntityInfo(entityType); + + // await db.Storageable(Enumerable.ToList(seedData)).ExecuteCommandAsync(); + // Console.WriteLine($"Table:{entity.DbTableName} seedData success!"); + // } + // } + + // //鑷畾涔夊鐞� + // { + // await instance.CustomizeSeedData(db); + // } + // } + //} + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Seed/FrameSeed.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Seed/FrameSeed.cs" new file mode 100644 index 0000000..4711bda --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Seed/FrameSeed.cs" @@ -0,0 +1,582 @@ +锘縰sing SqlSugar; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WIDESEA_Core.Seed +{ + public class FrameSeed + { + + /// <summary> + /// 鐢熸垚Controller灞� + /// </summary> + /// <param name="sqlSugarClient">sqlsugar瀹炰緥</param> + /// <param name="ConnId">鏁版嵁搴撻摼鎺D</param> + /// <param name="tableNames">鏁版嵁搴撹〃鍚嶆暟缁勶紝榛樿绌猴紝鐢熸垚鎵�鏈夎〃</param> + /// <param name="isMuti"></param> + /// <returns></returns> + public static bool CreateControllers(SqlSugarScope sqlSugarClient, string ConnId = null, bool isMuti = false, string[] tableNames = null) + { + Create_Controller_ClassFileByDBTalbe(sqlSugarClient, ConnId, $@"C:\my-file\Blog.Core.Api.Controllers", "Blog.Core.Api.Controllers", tableNames, "", isMuti); + return true; + } + + /// <summary> + /// 鐢熸垚Model灞� + /// </summary> + /// <param name="sqlSugarClient">sqlsugar瀹炰緥</param> + /// <param name="ConnId">鏁版嵁搴撻摼鎺D</param> + /// <param name="tableNames">鏁版嵁搴撹〃鍚嶆暟缁勶紝榛樿绌猴紝鐢熸垚鎵�鏈夎〃</param> + /// <param name="isMuti"></param> + /// <returns></returns> + public static bool CreateModels(SqlSugarScope sqlSugarClient, string ConnId, bool isMuti = false, string[] tableNames = null) + { + Create_Model_ClassFileByDBTalbe(sqlSugarClient, ConnId, $@"C:\my-file\Blog.Core.Model", "Blog.Core.Model.Models", tableNames, "", isMuti); + return true; + } + + /// <summary> + /// 鐢熸垚IRepository灞� + /// </summary> + /// <param name="sqlSugarClient">sqlsugar瀹炰緥</param> + /// <param name="ConnId">鏁版嵁搴撻摼鎺D</param> + /// <param name="isMuti"></param> + /// <param name="tableNames">鏁版嵁搴撹〃鍚嶆暟缁勶紝榛樿绌猴紝鐢熸垚鎵�鏈夎〃</param> + /// <returns></returns> + public static bool CreateIRepositorys(SqlSugarScope sqlSugarClient, string ConnId, bool isMuti = false, string[] tableNames = null) + { + Create_IRepository_ClassFileByDBTalbe(sqlSugarClient, ConnId, $@"C:\my-file\Blog.Core.IRepository", "Blog.Core.IRepository", tableNames, "", isMuti); + return true; + } + + + + /// <summary> + /// 鐢熸垚 IService 灞� + /// </summary> + /// <param name="sqlSugarClient">sqlsugar瀹炰緥</param> + /// <param name="ConnId">鏁版嵁搴撻摼鎺D</param> + /// <param name="isMuti"></param> + /// <param name="tableNames">鏁版嵁搴撹〃鍚嶆暟缁勶紝榛樿绌猴紝鐢熸垚鎵�鏈夎〃</param> + /// <returns></returns> + public static bool CreateIServices(SqlSugarScope sqlSugarClient, string ConnId, bool isMuti = false, string[] tableNames = null) + { + Create_IServices_ClassFileByDBTalbe(sqlSugarClient, ConnId, $@"C:\my-file\Blog.Core.IServices", "Blog.Core.IServices", tableNames, "", isMuti); + return true; + } + + + + /// <summary> + /// 鐢熸垚 Repository 灞� + /// </summary> + /// <param name="sqlSugarClient">sqlsugar瀹炰緥</param> + /// <param name="ConnId">鏁版嵁搴撻摼鎺D</param> + /// <param name="isMuti"></param> + /// <param name="tableNames">鏁版嵁搴撹〃鍚嶆暟缁勶紝榛樿绌猴紝鐢熸垚鎵�鏈夎〃</param> + /// <returns></returns> + public static bool CreateRepository(SqlSugarScope sqlSugarClient, string ConnId, bool isMuti = false, string[] tableNames = null) + { + Create_Repository_ClassFileByDBTalbe(sqlSugarClient, ConnId, $@"C:\my-file\Blog.Core.Repository", "Blog.Core.Repository", tableNames, "", isMuti); + return true; + } + + + + /// <summary> + /// 鐢熸垚 Service 灞� + /// </summary> + /// <param name="sqlSugarClient">sqlsugar瀹炰緥</param> + /// <param name="ConnId">鏁版嵁搴撻摼鎺D</param> + /// <param name="isMuti"></param> + /// <param name="tableNames">鏁版嵁搴撹〃鍚嶆暟缁勶紝榛樿绌猴紝鐢熸垚鎵�鏈夎〃</param> + /// <returns></returns> + public static bool CreateServices(SqlSugarScope sqlSugarClient, string ConnId, bool isMuti = false, string[] tableNames = null) + { + Create_Services_ClassFileByDBTalbe(sqlSugarClient, ConnId, $@"C:\my-file\Blog.Core.Services", "Blog.Core.Services", tableNames, "", isMuti); + return true; + } + + + #region 鏍规嵁鏁版嵁搴撹〃鐢熶骇Controller灞� + + /// <summary> + /// 鍔熻兘鎻忚堪:鏍规嵁鏁版嵁搴撹〃鐢熶骇Controller灞� + /// 浣溿��銆�鑰�:Blog.Core + /// </summary> + /// <param name="sqlSugarClient"></param> + /// <param name="ConnId">鏁版嵁搴撻摼鎺D</param> + /// <param name="strPath">瀹炰綋绫诲瓨鏀捐矾寰�</param> + /// <param name="strNameSpace">鍛藉悕绌洪棿</param> + /// <param name="lstTableNames">鐢熶骇鎸囧畾鐨勮〃</param> + /// <param name="strInterface">瀹炵幇鎺ュ彛</param> + /// <param name="isMuti"></param> + /// <param name="blnSerializable">鏄惁搴忓垪鍖�</param> + private static void Create_Controller_ClassFileByDBTalbe( + SqlSugarScope sqlSugarClient, + string ConnId, + string strPath, + string strNameSpace, + string[] lstTableNames, + string strInterface, + bool isMuti = false, + bool blnSerializable = false) + { + var IDbFirst = sqlSugarClient.DbFirst; + if (lstTableNames != null && lstTableNames.Length > 0) + { + IDbFirst = IDbFirst.Where(lstTableNames); + } + var ls = IDbFirst.IsCreateDefaultValue().IsCreateAttribute() + + .SettingClassTemplate(p => p = +@"using Blog.Core.IServices; +using Blog.Core.Model; +using Blog.Core.Model.Models; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using System; +using System.Linq.Expressions; +using System.Threading.Tasks; + +namespace " + strNameSpace + @" +{ + [Route(""api/[controller]/[action]"")] + [ApiController] + [Authorize(Permissions.Name)] + public class {ClassName}Controller : ControllerBase + { + /// <summary> + /// 鏈嶅姟鍣ㄦ帴鍙o紝鍥犱负鏄ā鏉跨敓鎴愶紝鎵�浠ラ瀛楁瘝鏄ぇ鍐欑殑锛岃嚜宸卞彲浠ラ噸鏋勪笅 + /// </summary> + private readonly I{ClassName}Services _{ClassName}Services; + + public {ClassName}Controller(I{ClassName}Services {ClassName}Services) + { + _{ClassName}Services = {ClassName}Services; + } + + [HttpGet] + public async Task<MessageModel<PageModel<{ClassName}>>> Get(int page = 1, string key = """",int intPageSize = 50) + { + if (string.IsNullOrEmpty(key) || string.IsNullOrWhiteSpace(key)) + { + key = """"; + } + + Expression<Func<{ClassName}, bool>> whereExpression = a => true; + + return new MessageModel<PageModel<{ClassName}>>() + { + msg = ""鑾峰彇鎴愬姛"", + success = true, + response = await _{ClassName}Services.QueryPage(whereExpression, page, intPageSize) + }; + + } + + [HttpGet(""{id}"")] + public async Task<MessageModel<{ClassName}>> Get(string id) + { + return new MessageModel<{ClassName}>() + { + msg = ""鑾峰彇鎴愬姛"", + success = true, + response = await _{ClassName}Services.QueryById(id) + }; + } + + [HttpPost] + public async Task<MessageModel<string>> Post([FromBody] {ClassName} request) + { + var data = new MessageModel<string>(); + + var id = await _{ClassName}Services.Add(request); + data.success = id > 0; + if (data.success) + { + data.response = id.ObjToString(); + data.msg = ""娣诲姞鎴愬姛""; + } + + return data; + } + + [HttpPut] + public async Task<MessageModel<string>> Put([FromBody] {ClassName} request) + { + var data = new MessageModel<string>(); + data.success = await _{ClassName}Services.Update(request); + if (data.success) + { + data.msg = ""鏇存柊鎴愬姛""; + data.response = request?.id.ObjToString(); + } + + return data; + } + + [HttpDelete] + public async Task<MessageModel<string>> Delete(int id) + { + var data = new MessageModel<string>(); + var model = await _{ClassName}Services.QueryById(id); + model.IsDeleted = true; + data.success = await _departmentServices.Update(model); + if (data.success) + { + data.msg = ""鍒犻櫎鎴愬姛""; + data.response = model?.Id.ObjToString(); + } + + return data; + } + } +}") + + .ToClassStringList(strNameSpace); + + Dictionary<string, string> newdic = new Dictionary<string, string>(); + //寰幆澶勭悊 棣栧瓧姣嶅皬鍐� 骞舵彃鍏ユ柊鐨� Dictionary + foreach (KeyValuePair<string, string> item in ls) + { + string newkey = "_" + item.Key.First().ToString().ToLower() + item.Key.Substring(1); + string newvalue = item.Value.Replace("_" + item.Key, newkey); + newdic.Add(item.Key, newvalue); + } + CreateFilesByClassStringList(newdic, strPath, "{0}Controller"); + } + #endregion + + + #region 鏍规嵁鏁版嵁搴撹〃鐢熶骇Model灞� + + /// <summary> + /// 鍔熻兘鎻忚堪:鏍规嵁鏁版嵁搴撹〃鐢熶骇Model灞� + /// 浣溿��銆�鑰�:Blog.Core + /// </summary> + /// <param name="sqlSugarClient"></param> + /// <param name="ConnId">鏁版嵁搴撻摼鎺D</param> + /// <param name="strPath">瀹炰綋绫诲瓨鏀捐矾寰�</param> + /// <param name="strNameSpace">鍛藉悕绌洪棿</param> + /// <param name="lstTableNames">鐢熶骇鎸囧畾鐨勮〃</param> + /// <param name="strInterface">瀹炵幇鎺ュ彛</param> + /// <param name="isMuti"></param> + /// <param name="blnSerializable">鏄惁搴忓垪鍖�</param> + private static void Create_Model_ClassFileByDBTalbe( + SqlSugarScope sqlSugarClient, + string ConnId, + string strPath, + string strNameSpace, + string[] lstTableNames, + string strInterface, + bool isMuti = false, + bool blnSerializable = false) + { + //澶氬簱鏂囦欢鍒嗙 + if (isMuti) + { + strPath = strPath + @"\Models\" + ConnId; + strNameSpace = strNameSpace + "." + ConnId; + } + + var IDbFirst = sqlSugarClient.DbFirst; + if (lstTableNames != null && lstTableNames.Length > 0) + { + IDbFirst = IDbFirst.Where(lstTableNames); + } + var ls = IDbFirst.IsCreateDefaultValue().IsCreateAttribute() + + .SettingClassTemplate(p => p = +@"{using} + +namespace " + strNameSpace + @" +{ +{ClassDescription} + [SugarTable( ""{ClassName}"", """ + ConnId + @""")]" + (blnSerializable ? "\n [Serializable]" : "") + @" + public class {ClassName}" + (string.IsNullOrEmpty(strInterface) ? "" : (" : " + strInterface)) + @" + { + public {ClassName}() + { + } +{PropertyName} + } +}") + //.SettingPropertyDescriptionTemplate(p => p = string.Empty) + .SettingPropertyTemplate(p => p = +@"{SugarColumn} + public {PropertyType} {PropertyName} { get; set; }") + + //.SettingConstructorTemplate(p => p = " this._{PropertyName} ={DefaultValue};") + + .ToClassStringList(strNameSpace); + CreateFilesByClassStringList(ls, strPath, "{0}"); + } + #endregion + + + #region 鏍规嵁鏁版嵁搴撹〃鐢熶骇IRepository灞� + + /// <summary> + /// 鍔熻兘鎻忚堪:鏍规嵁鏁版嵁搴撹〃鐢熶骇IRepository灞� + /// 浣溿��銆�鑰�:Blog.Core + /// </summary> + /// <param name="sqlSugarClient"></param> + /// <param name="ConnId">鏁版嵁搴撻摼鎺D</param> + /// <param name="strPath">瀹炰綋绫诲瓨鏀捐矾寰�</param> + /// <param name="strNameSpace">鍛藉悕绌洪棿</param> + /// <param name="lstTableNames">鐢熶骇鎸囧畾鐨勮〃</param> + /// <param name="strInterface">瀹炵幇鎺ュ彛</param> + /// <param name="isMuti"></param> + private static void Create_IRepository_ClassFileByDBTalbe( + SqlSugarScope sqlSugarClient, + string ConnId, + string strPath, + string strNameSpace, + string[] lstTableNames, + string strInterface, + bool isMuti = false + ) + { + //澶氬簱鏂囦欢鍒嗙 + if (isMuti) + { + strPath = strPath + @"\" + ConnId; + strNameSpace = strNameSpace + "." + ConnId; + } + + var IDbFirst = sqlSugarClient.DbFirst; + if (lstTableNames != null && lstTableNames.Length > 0) + { + IDbFirst = IDbFirst.Where(lstTableNames); + } + var ls = IDbFirst.IsCreateDefaultValue().IsCreateAttribute() + + .SettingClassTemplate(p => p = +@"using Blog.Core.IRepository.Base; +using Blog.Core.Model.Models" + (isMuti ? "." + ConnId + "" : "") + @"; + +namespace " + strNameSpace + @" +{ + /// <summary> + /// I{ClassName}Repository + /// </summary> + public interface I{ClassName}Repository : IBaseRepository<{ClassName}>" + (string.IsNullOrEmpty(strInterface) ? "" : (" , " + strInterface)) + @" + { + } +}") + + .ToClassStringList(strNameSpace); + CreateFilesByClassStringList(ls, strPath, "I{0}Repository"); + } + #endregion + + + #region 鏍规嵁鏁版嵁搴撹〃鐢熶骇IServices灞� + + /// <summary> + /// 鍔熻兘鎻忚堪:鏍规嵁鏁版嵁搴撹〃鐢熶骇IServices灞� + /// 浣溿��銆�鑰�:Blog.Core + /// </summary> + /// <param name="sqlSugarClient"></param> + /// <param name="ConnId">鏁版嵁搴撻摼鎺D</param> + /// <param name="strPath">瀹炰綋绫诲瓨鏀捐矾寰�</param> + /// <param name="strNameSpace">鍛藉悕绌洪棿</param> + /// <param name="lstTableNames">鐢熶骇鎸囧畾鐨勮〃</param> + /// <param name="strInterface">瀹炵幇鎺ュ彛</param> + /// <param name="isMuti"></param> + private static void Create_IServices_ClassFileByDBTalbe( + SqlSugarScope sqlSugarClient, + string ConnId, + string strPath, + string strNameSpace, + string[] lstTableNames, + string strInterface, + bool isMuti = false) + { + //澶氬簱鏂囦欢鍒嗙 + if (isMuti) + { + strPath = strPath + @"\" + ConnId; + strNameSpace = strNameSpace + "." + ConnId; + } + + var IDbFirst = sqlSugarClient.DbFirst; + if (lstTableNames != null && lstTableNames.Length > 0) + { + IDbFirst = IDbFirst.Where(lstTableNames); + } + var ls = IDbFirst.IsCreateDefaultValue().IsCreateAttribute() + + .SettingClassTemplate(p => p = +@"using Blog.Core.IServices.BASE; +using Blog.Core.Model.Models" + (isMuti ? "." + ConnId + "" : "") + @"; + +namespace " + strNameSpace + @" +{ + /// <summary> + /// I{ClassName}Services + /// </summary> + public interface I{ClassName}Services :IBaseServices<{ClassName}>" + (string.IsNullOrEmpty(strInterface) ? "" : (" , " + strInterface)) + @" + { + } +}") + + .ToClassStringList(strNameSpace); + CreateFilesByClassStringList(ls, strPath, "I{0}Services"); + } + #endregion + + + + #region 鏍规嵁鏁版嵁搴撹〃鐢熶骇 Repository 灞� + + /// <summary> + /// 鍔熻兘鎻忚堪:鏍规嵁鏁版嵁搴撹〃鐢熶骇 Repository 灞� + /// 浣溿��銆�鑰�:Blog.Core + /// </summary> + /// <param name="sqlSugarClient"></param> + /// <param name="ConnId">鏁版嵁搴撻摼鎺D</param> + /// <param name="strPath">瀹炰綋绫诲瓨鏀捐矾寰�</param> + /// <param name="strNameSpace">鍛藉悕绌洪棿</param> + /// <param name="lstTableNames">鐢熶骇鎸囧畾鐨勮〃</param> + /// <param name="strInterface">瀹炵幇鎺ュ彛</param> + /// <param name="isMuti"></param> + private static void Create_Repository_ClassFileByDBTalbe( + SqlSugarScope sqlSugarClient, + string ConnId, + string strPath, + string strNameSpace, + string[] lstTableNames, + string strInterface, + bool isMuti = false) + { + //澶氬簱鏂囦欢鍒嗙 + if (isMuti) + { + strPath = strPath + @"\" + ConnId; + strNameSpace = strNameSpace + "." + ConnId; + } + + var IDbFirst = sqlSugarClient.DbFirst; + if (lstTableNames != null && lstTableNames.Length > 0) + { + IDbFirst = IDbFirst.Where(lstTableNames); + } + var ls = IDbFirst.IsCreateDefaultValue().IsCreateAttribute() + + .SettingClassTemplate(p => p = +@"using Blog.Core.IRepository" + (isMuti ? "." + ConnId + "" : "") + @"; +using Blog.Core.IRepository.UnitOfWork; +using Blog.Core.Model.Models" + (isMuti ? "." + ConnId + "" : "") + @"; +using Blog.Core.Repository.Base; + +namespace " + strNameSpace + @" +{ + /// <summary> + /// {ClassName}Repository + /// </summary> + public class {ClassName}Repository : BaseRepository<{ClassName}>, I{ClassName}Repository" + (string.IsNullOrEmpty(strInterface) ? "" : (" , " + strInterface)) + @" + { + public {ClassName}Repository(IUnitOfWork unitOfWork) : base(unitOfWork) + { + } + } +}") + .ToClassStringList(strNameSpace); + + + CreateFilesByClassStringList(ls, strPath, "{0}Repository"); + } + #endregion + + + #region 鏍规嵁鏁版嵁搴撹〃鐢熶骇 Services 灞� + + /// <summary> + /// 鍔熻兘鎻忚堪:鏍规嵁鏁版嵁搴撹〃鐢熶骇 Services 灞� + /// 浣溿��銆�鑰�:Blog.Core + /// </summary> + /// <param name="sqlSugarClient"></param> + /// <param name="ConnId">鏁版嵁搴撻摼鎺D</param> + /// <param name="strPath">瀹炰綋绫诲瓨鏀捐矾寰�</param> + /// <param name="strNameSpace">鍛藉悕绌洪棿</param> + /// <param name="lstTableNames">鐢熶骇鎸囧畾鐨勮〃</param> + /// <param name="strInterface">瀹炵幇鎺ュ彛</param> + /// <param name="isMuti"></param> + private static void Create_Services_ClassFileByDBTalbe( + SqlSugarScope sqlSugarClient, + string ConnId, + string strPath, + string strNameSpace, + string[] lstTableNames, + string strInterface, + bool isMuti = false) + { + //澶氬簱鏂囦欢鍒嗙 + if (isMuti) + { + strPath = strPath + @"\" + ConnId; + strNameSpace = strNameSpace + "." + ConnId; + } + + var IDbFirst = sqlSugarClient.DbFirst; + if (lstTableNames != null && lstTableNames.Length > 0) + { + IDbFirst = IDbFirst.Where(lstTableNames); + } + var ls = IDbFirst.IsCreateDefaultValue().IsCreateAttribute() + + .SettingClassTemplate(p => p = +@" +using Blog.Core.IServices" + (isMuti ? "." + ConnId + "" : "") + @"; +using Blog.Core.Model.Models" + (isMuti ? "." + ConnId + "" : "") + @"; +using Blog.Core.Services.BASE; +using Blog.Core.IRepository.Base; + +namespace " + strNameSpace + @" +{ + public class {ClassName}Services : BaseServices<{ClassName}>, I{ClassName}Services" + (string.IsNullOrEmpty(strInterface) ? "" : (" , " + strInterface)) + @" + { + private readonly IBaseRepository<{ClassName}> _dal; + public {ClassName}Services(IBaseRepository<{ClassName}> dal) + { + this._dal = dal; + base.BaseDal = dal; + } + } +}") + .ToClassStringList(strNameSpace); + + CreateFilesByClassStringList(ls, strPath, "{0}Services"); + } + #endregion + + + #region 鏍规嵁妯℃澘鍐呭鎵归噺鐢熸垚鏂囦欢 + /// <summary> + /// 鏍规嵁妯℃澘鍐呭鎵归噺鐢熸垚鏂囦欢 + /// </summary> + /// <param name="ls">绫绘枃浠跺瓧绗︿覆list</param> + /// <param name="strPath">鐢熸垚璺緞</param> + /// <param name="fileNameTp">鏂囦欢鍚嶆牸寮忔ā鏉�</param> + private static void CreateFilesByClassStringList(Dictionary<string, string> ls, string strPath, string fileNameTp) + { + + foreach (var item in ls) + { + var fileName = $"{string.Format(fileNameTp, item.Key)}.cs"; + var fileFullPath = Path.Combine(strPath, fileName); + if (!Directory.Exists(strPath)) + { + Directory.CreateDirectory(strPath); + } + File.WriteAllText(fileFullPath, item.Value, Encoding.UTF8); + } + } + #endregion + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Tenants/ITenantEntity.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Tenants/ITenantEntity.cs" new file mode 100644 index 0000000..ca499c4 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Tenants/ITenantEntity.cs" @@ -0,0 +1,21 @@ +锘縰sing SqlSugar; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WIDESEA_Core.Tenants +{ + /// <summary> + /// 绉熸埛妯″瀷鎺ュ彛 + /// </summary> + public interface ITenantEntity + { + /// <summary> + /// 绉熸埛Id + /// </summary> + [SugarColumn(DefaultValue = "0")] + public long TenantId { get; set; } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Tenants/MultiTenantAttribute.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Tenants/MultiTenantAttribute.cs" new file mode 100644 index 0000000..a0927c3 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Tenants/MultiTenantAttribute.cs" @@ -0,0 +1,56 @@ +锘縰sing System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WIDESEA_Core.Tenants +{ + /// <summary> + /// 鏍囪瘑 澶氱鎴� 鐨勪笟鍔¤〃 <br/> + /// 榛樿璁剧疆鏄搴� <br/> + /// 鍏叡琛ㄦ棤闇�鍖哄垎 鐩存帴浣跨敤涓诲簱 鍚勮嚜涓氬姟鍦ㄥ悇鑷簱涓� <br/> + /// </summary> + [AttributeUsage(AttributeTargets.Class)] + public class MultiTenantAttribute : Attribute + { + public MultiTenantAttribute() + { + } + + public MultiTenantAttribute(TenantTypeEnum tenantType) + { + TenantType = tenantType; + } + + + public TenantTypeEnum TenantType { get; set; } = TenantTypeEnum.Db; + } + + /// <summary> + /// 绉熸埛闅旂鏂规 + /// </summary> + public enum TenantTypeEnum + { + None = 0, + + /// <summary> + /// Id闅旂 + /// </summary> + [Description("Id闅旂")] + Id = 1, + + /// <summary> + /// 搴撻殧绂� + /// </summary> + [Description("搴撻殧绂�")] + Db = 2, + + /// <summary> + /// 琛ㄩ殧绂� + /// </summary> + [Description("琛ㄩ殧绂�")] + Tables = 3, + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Tenants/TenantUtil.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Tenants/TenantUtil.cs" new file mode 100644 index 0000000..a0a9755 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Tenants/TenantUtil.cs" @@ -0,0 +1,127 @@ +锘縰sing SqlSugar; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Core.DB; + +namespace WIDESEA_Core.Tenants +{ + public static class TenantUtil + { + //public static SysTenant DefaultTenantConfig(this SysTenant tenant) + //{ + // tenant.DbType ??= DbType.Sqlite; + + // //濡傛灉娌℃湁閰嶇疆杩炴帴 + // if (tenant.Connection.IsNullOrEmpty()) + // { + // //姝ゅ榛樿閰嶇疆 Sqlite 鍦板潃 + // //瀹為檯涓氬姟涓� 涔熶細鏈夎繍缁淬�佺郴缁熺鐞嗗憳绛夋潵缁存姢 + // switch (tenant.DbType.Value) + // { + // case DbType.Sqlite: + // tenant.Connection = $"DataSource={Path.Combine(Environment.CurrentDirectory, tenant.ConfigId)}.db"; + // break; + // } + // } + + // return tenant; + //} + + //public static ConnectionConfig GetConnectionConfig(this SysTenant tenant) + //{ + // if (tenant.DbType is null) + // { + // throw new ArgumentException("Tenant DbType Must"); + // } + + + // return new ConnectionConfig() + // { + // ConfigId = tenant.ConfigId, + // DbType = tenant.DbType.Value, + // ConnectionString = tenant.Connection, + // IsAutoCloseConnection = true, + // MoreSettings = new ConnMoreSettings() + // { + // IsAutoRemoveDataCache = true + // }, + // }; + //} + + public static List<Type> GetTenantEntityTypes(TenantTypeEnum? tenantType = null) + { + List<Type> types = RepositorySetting.Entitys.Where(u => !u.IsInterface && !u.IsAbstract && u.IsClass).ToList(); + + List<Type> returnTypes = types.Where(s => IsTenantEntity(s, tenantType)).ToList(); + return returnTypes; + } + + public static bool IsTenantEntity(this Type u, TenantTypeEnum? tenantType = null) + { + var mta = u.GetCustomAttribute<MultiTenantAttribute>(); + if (mta is null) + { + return false; + } + + if (tenantType != null) + { + if (mta.TenantType != tenantType) + { + return false; + } + } + + return true; + } + + public static string GetTenantTableName(this Type type, ISqlSugarClient db, string id) + { + var entityInfo = db.EntityMaintenance.GetEntityInfo(type); + return $@"{entityInfo.DbTableName}_{id}"; + } + + //public static string GetTenantTableName(this Type type, ISqlSugarClient db, SysTenant tenant) + //{ + // return GetTenantTableName(type, db, tenant.Id.ToString()); + //} + + public static void SetTenantTable(this ISqlSugarClient db, string id) + { + var types = GetTenantEntityTypes(TenantTypeEnum.Tables); + + foreach (var type in types) + { + db.MappingTables.Add(type.Name, type.GetTenantTableName(db, id)); + } + } + + public static List<SelectModel> GetTenantSelectModels() + { + List<SelectModel> selectModels = new List<SelectModel>() + { + new SelectModel + { + FieldName = MainDb.TenantId + }, + //new SelectModel + //{ + // FieldName = MainDb.TenantName + //}, + new SelectModel + { + FieldName = MainDb.ConnectionString, + }, + new SelectModel + { + FieldName = MainDb.TenantDbType + } + }; + return selectModels; + } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Utilities/EntityProperties.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Utilities/EntityProperties.cs" new file mode 100644 index 0000000..367eda1 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Utilities/EntityProperties.cs" @@ -0,0 +1,311 @@ +锘縰sing SqlSugar; +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; +using System.Reflection; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Core.Const; +using WIDESEA_Core.DB.Models; +using WIDESEA_Core.Helper; + +namespace WIDESEA_Core.Utilities +{ + public static class EntityProperties + { + /// <summary> + /// 楠岃瘉鏁版嵁搴撳瓧娈电被鍨嬩笌鍊兼槸鍚︽纭紝 + /// </summary> + /// <param name="dbType">鏁版嵁搴撳瓧娈电被鍨�(濡倂archar,nvarchar,decimal,涓嶈甯﹀悗闈㈤暱搴﹀:varchar(50))</param> + /// <param name="value">鍊�</param> + /// <param name="propertyInfo">瑕侀獙璇佺殑绫荤殑灞炴�э紝鑻ヤ笉涓簄ull锛屽垯浼氬垽鏂瓧绗︿覆鐨勯暱搴︽槸鍚︽纭�</param> + /// <returns>(bool, string, object)bool鎴愬惁鏍¢獙鎴愬姛,string鏍¢獙澶辫触淇℃伅,object,褰撳墠鏍¢獙鐨勫��</returns> + public static (bool, string, object) ValidationVal(this PropertyInfo propertyInfo, object value) + { + string dbType = ""; + SugarColumn sugarColumn = null; + if (propertyInfo != null) + { + sugarColumn = propertyInfo.GetCustomAttribute<SugarColumn>(); + dbType = propertyInfo != null ? propertyInfo.GetProperWithDbType() : SqlDbTypeName.NVarChar; + } + dbType = dbType.ToLower(); + string val = value?.ToString(); + //楠岃瘉闀垮害 + string reslutMsg = string.Empty; + if (dbType == SqlDbTypeName.Int) + { + if (!value.IsInt()) + reslutMsg = "鍙兘涓烘湁鏁堟暣鏁�"; + } //2021.10.12澧炲姞灞炴�ф牎楠宭ong绫诲瀷鐨勬敮鎸� + else if (dbType == SqlDbTypeName.BigInt) + { + if (!long.TryParse(val, out _)) + { + reslutMsg = "鍙兘涓烘湁鏁堟暣鏁�"; + } + } + else if (dbType == SqlDbTypeName.DateTime + || dbType == SqlDbTypeName.Date + || dbType == SqlDbTypeName.SmallDateTime + || dbType == SqlDbTypeName.SmallDate + ) + { + if (!value.IsDate()) + reslutMsg = "蹇呴』涓烘棩鏈熸牸寮�"; + } + else if (dbType == SqlDbTypeName.Float || dbType == SqlDbTypeName.Decimal || dbType == SqlDbTypeName.Double) + { + if (!val.IsNumber(null)) + { + reslutMsg = "涓嶆槸鏈夋晥鏁板瓧"; + } + } + else if (dbType == SqlDbTypeName.UniqueIdentifier) + { + if (!val.IsGuid()) + { + reslutMsg = propertyInfo.Name + "Guid涓嶆纭�"; + } + } + else if (propertyInfo != null + && (dbType == SqlDbTypeName.VarChar + || dbType == SqlDbTypeName.NVarChar + || dbType == SqlDbTypeName.NChar + || dbType == SqlDbTypeName.Char + || dbType == SqlDbTypeName.Text)) + { + //榛樿nvarchar(max) 銆乼ext 闀垮害涓嶈兘瓒呰繃20000 + if (val.Length > 200000) + { + reslutMsg = $"瀛楃闀垮害鏈�澶氥��200000銆�"; + } + else + { + int length = sugarColumn.Length; + if (length == 0) { return (true, null, null); } + //鍒ゆ柇鍙屽瓧鑺備笌鍗曞瓧娈� + else if (length < 8000 && + ((dbType.Substring(0, 1) != "n" + && Encoding.UTF8.GetBytes(val.ToCharArray()).Length > length) + || val.Length > length) + ) + { + reslutMsg = $"鏈�澶氬彧鑳姐�恵length}銆戜釜瀛楃銆�"; + } + } + } + if (!string.IsNullOrEmpty(reslutMsg) && propertyInfo != null) + { + reslutMsg = sugarColumn.ColumnDescription + reslutMsg; + } + return (reslutMsg == "" ? true : false, reslutMsg, value); + } + + private static readonly Dictionary<Type, string> ProperWithDbType = new Dictionary<Type, string>() { + { typeof(string),SqlDbTypeName.NVarChar }, + { typeof(DateTime),SqlDbTypeName.DateTime}, + {typeof(long),SqlDbTypeName.BigInt }, + {typeof(int),SqlDbTypeName.Int}, + { typeof(decimal),SqlDbTypeName.Decimal }, + { typeof(float),SqlDbTypeName.Float }, + { typeof(double),SqlDbTypeName.Double }, + { typeof(byte),SqlDbTypeName.Int },//绫诲瀷寰呭畬 + { typeof(Guid),SqlDbTypeName.UniqueIdentifier} + }; + + public static string GetProperWithDbType(this PropertyInfo propertyInfo) + { + bool result = ProperWithDbType.TryGetValue(propertyInfo.PropertyType, out string value); + if (result) + { + return value; + } + return SqlDbTypeName.NVarChar; + } + + public static string ValidateDicInEntity(this Type typeinfo, List<Dictionary<string, object>> dicList, bool removerKey, string[] ignoreFields = null) + { + PropertyInfo[] propertyInfo = typeinfo.GetProperties(); + string reslutMsg = string.Empty; + foreach (Dictionary<string, object> dic in dicList) + { + reslutMsg = typeinfo.ValidateDicInEntity(dic, removerKey, propertyInfo, ignoreFields); + if (!string.IsNullOrEmpty(reslutMsg)) + return reslutMsg; + } + return reslutMsg; + } + + /// <summary> + /// 鍒ゆ柇hash鐨勫垪鏄惁涓哄搴旂殑瀹炰綋锛屽苟涓斿�兼槸鍚︽湁鏁� + /// </summary> + /// <param name="typeinfo"></param> + /// <param name="dic"></param> + /// <param name="removeNotContains">绉婚櫎涓嶅瓨鍦ㄥ瓧娈�</param> + /// <param name="removerKey">绉婚櫎涓婚敭</param> + /// <returns></returns> + public static string ValidateDicInEntity(this Type typeinfo, Dictionary<string, object> dic, bool removerKey, PropertyInfo[] propertyInfo, string[] ignoreFields = null) + { + if (dic == null || dic.Count == 0) { return "鍙傛暟鏃犳晥"; } + + // 涓嶅瓨鍦ㄧ殑瀛楁鐩存帴绉婚櫎 + dic.Where(x => !propertyInfo.Any(p => p.Name == x.Key.FirstLetterToUpper())).Select(s => s.Key).ToList().ForEach(f => + { + dic.Remove(f); + }); + + string keyName = typeinfo.GetKeyName(); + //绉婚櫎涓婚敭 + if (removerKey) + dic.Remove(keyName); + //else + //{ + // if (!dic.ContainsKey(keyName)) + // return "璇蜂紶鍏ヤ富閿弬鏁�"; + //} + + foreach (PropertyInfo property in propertyInfo) + { + SugarColumn sugarColumn = property.GetCustomAttribute<SugarColumn>(); + if (sugarColumn == null) + return "璇烽厤缃甋ugarColumn灞炴��"; + //蹇界暐涓庝富閿殑瀛楁涓嶅仛楠岃瘉 + if (property.Name == keyName.FirstLetterToUpper() || (ignoreFields != null && ignoreFields.Contains(property.Name)) || sugarColumn.IsOnlyIgnoreInsert || sugarColumn.IsOnlyIgnoreUpdate || sugarColumn.IsIgnore) + continue; + + //涓嶅湪缂栬緫涓殑鍒楋紝鏄惁涔熻蹇呭~ + if (!dic.ContainsKey(property.Name.FirstLetterToLower())) + { + if (!sugarColumn.IsNullable) + { + if (sugarColumn.DefaultValue != null) + return sugarColumn.ColumnDescription + "涓哄繀椤绘彁浜ら」"; + continue; + } + continue; + } + string str = dic.GetValueOrDefault(property.Name.FirstLetterToLower(), "").ToString(); + //灏嗘墍鏈夌┖鍊艰缃负null + if (dic[property.Name.FirstLetterToLower()] != null && str == string.Empty) + dic[property.Name.FirstLetterToLower()] = null; + } + return string.Empty; + } + + /// <summary> + /// 瀹夊叏鑾峰彇瀛楀吀鍊硷紝濡傛灉閿笉瀛樺湪鎴栧�间负null鍒欒繑鍥為粯璁ゅ�� + /// </summary> + /// <typeparam name="TKey">瀛楀吀閿殑绫诲瀷</typeparam> + /// <typeparam name="TValue">瀛楀吀鍊肩殑绫诲瀷</typeparam> + /// <param name="dictionary">瀛楀吀瀹炰緥</param> + /// <param name="key">閿�</param> + /// <param name="defaultValue">榛樿鍊�</param> + /// <returns>瀛楀吀鍊兼垨榛樿鍊�</returns> + public static TValue GetValueOrDefault<TKey, TValue>(this IDictionary<TKey, TValue> dictionary, TKey key, TValue defaultValue = default) + { + if (dictionary == null) throw new ArgumentNullException(nameof(dictionary)); + + return dictionary.TryGetValue(key, out TValue value) && value != null ? value : defaultValue; + } + + public static string GetKeyName(this Type typeinfo) + { + return typeinfo.GetProperties().GetKeyName(); + } + + public static string GetKeyName(this PropertyInfo[] properties) + { + foreach (PropertyInfo property in properties) + { + SugarColumn sugarColumn = property.GetCustomAttribute<SugarColumn>(); + if (sugarColumn.IsPrimaryKey) + return property.Name; + } + return null; + } + + public static PropertyInfo GetKeyProperty(this Type typeinfo) + { + PropertyInfo[] properties = typeinfo.GetProperties(); + foreach (PropertyInfo property in properties) + { + SugarColumn sugarColumn = property.GetCustomAttribute<SugarColumn>(); + if (sugarColumn?.IsPrimaryKey ?? false) + { + return property; + } + } + return null; + } + + public static Type GetDetailType(this Type typeinfo) + { + PropertyInfo[] properties = typeinfo.GetProperties(); + foreach (PropertyInfo property in properties) + { + Navigate? navigate = property.GetCustomAttribute<Navigate>(); + if (navigate is not null) + { + if (navigate.GetNavigateType() == NavigateType.OneToOne) + return property.PropertyType; + else + return property.PropertyType.GenericTypeArguments[0]; + } + } + return null; + } + + public static string GetMainIdByDetail(this Type typeinfo) + { + PropertyInfo[] properties = typeinfo.GetProperties(); + foreach (PropertyInfo property in properties) + { + Navigate? navigate = property.GetCustomAttribute<Navigate>(); + if (navigate is not null) + { + return navigate.GetName(); + } + } + return null; + } + + public static void SetDetailId<T>(this Type typeinfo, T enetiy, object id, string name) + { + PropertyInfo property = typeinfo.GetProperty(name); + if (property != null) + { + property.SetValue(enetiy, id); + } + } + + public static PropertyInfo? GetNavigatePro(this Type typeinfo) + { + PropertyInfo[] properties = typeinfo.GetProperties(); + foreach (PropertyInfo property in properties) + { + Navigate? navigate = property.GetCustomAttribute<Navigate>(); + if (navigate is not null) + { + return property; + } + } + return null; + } + + public static object GetPropertyValue<T>(this Type typeinfo, T data, string propertyName) + { + if (typeinfo != typeof(T)) + return null; + + PropertyInfo? property = typeinfo.GetProperty(propertyName); + if (property != null) + { + return property.GetValue(data); + } + return null; + } + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Utilities/LambdaExtensions.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Utilities/LambdaExtensions.cs" new file mode 100644 index 0000000..459408a --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Utilities/LambdaExtensions.cs" @@ -0,0 +1,183 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Linq.Expressions; +using System.Reflection; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Core.Enums; +using WIDESEA_Core.Helper; + +namespace WIDESEA_Core.Utilities +{ + public static class LambdaExtensions + { + /// <summary> + /// + /// </summary> + /// <typeparam name="T"></typeparam> + /// <param name="propertyName">瀛楁鍚�</param> + /// <param name="propertyValue">琛ㄨ揪寮忕殑鍊�</param> + /// <param name="expressionType">鍒涘缓琛ㄨ揪寮忕殑绫诲瀷,濡�:p=>p.propertyName != propertyValue + /// p=>p.propertyName.Contains(propertyValue)</param> + /// <returns></returns> + public static Expression<Func<T, bool>> CreateExpression<T>(this string propertyName, object propertyValue, LinqExpressionType expressionType) + { + return propertyName.CreateExpression<T>(propertyValue, null, expressionType); + } + + /// <summary> + /// + /// </summary> + /// <typeparam name="T"></typeparam> + /// <param name="propertyName">瀛楁鍚�</param> + /// <param name="propertyValue">琛ㄨ揪寮忕殑鍊�</param> + /// <param name="expressionType">鍒涘缓琛ㄨ揪寮忕殑绫诲瀷,濡�:p=>p.propertyName != propertyValue + /// p=>p.propertyName.Contains(propertyValue)</param> + /// <returns></returns> + private static Expression<Func<T, bool>> CreateExpression<T>( + this string propertyName, + object propertyValue, + ParameterExpression parameter, + LinqExpressionType expressionType) + { + Type proType = null; + PropertyInfo propertyInfo = typeof(T).GetProperty(propertyName); + if (propertyInfo != null) + proType = propertyInfo.PropertyType; + else + { + propertyInfo = typeof(T).GetProperty(propertyName.FirstLetterToLower()); + if (propertyInfo != null) + proType = propertyInfo.PropertyType; + else + { + propertyInfo = typeof(T).GetProperty(propertyName.FirstLetterToUpper()); + if (propertyInfo != null) + proType = propertyInfo.PropertyType; + else + { + throw new Exception($"鏈壘鍒拌灞炴��,type:{typeof(T)}"); + } + } + } + //鍒涘缓鑺傜偣鍙橀噺濡俻=>鐨勮妭鐐筽 + // parameter ??= Expression.Parameter(typeof(T), "p");//鍒涘缓鍙傛暟p + parameter = parameter ?? Expression.Parameter(typeof(T), "p"); + + //鍒涘缓鑺傜偣鐨勫睘鎬=>p.name 灞炴�ame + MemberExpression memberProperty = Expression.PropertyOrField(parameter, propertyName); + if (expressionType == LinqExpressionType.In) + { + if (!(propertyValue is System.Collections.IList list) || list.Count == 0) throw new Exception("灞炴�у�肩被鍨嬩笉姝g‘"); + + bool isStringValue = true; + List<object> objList = new List<object>(); + + if (proType.ToString() != "System.String") + { + isStringValue = false; + foreach (var value in list) + { + objList.Add(value.ToString().ChangeType(proType)); + } + list = objList; + } + + if (isStringValue) + { + //string 绫诲瀷鐨勫瓧娈碉紝濡傛灉鍊煎甫鏈�'鍗曞紩鍙�,EF浼氶粯璁ゅ彉鎴�''涓や釜鍗曞紩鍙� + MethodInfo method = typeof(System.Collections.IList).GetMethod("Contains"); + //鍒涘缓闆嗗悎甯搁噺骞惰缃负甯搁噺鐨勫�� + ConstantExpression constantCollection = Expression.Constant(list); + //鍒涘缓涓�涓〃绀鸿皟鐢ㄥ甫鍙傛暟鐨勬柟娉曠殑锛歯ew string[]{"1","a"}.Contains("a"); + MethodCallExpression methodCall = Expression.Call(constantCollection, method, memberProperty); + return Expression.Lambda<Func<T, bool>>(methodCall, parameter); + } + //闈瀞tring瀛楁锛屾寜涓婇潰鏂瑰紡澶勭悊鎶ュ紓甯窷ull TypeMapping in Sql Tree + BinaryExpression body = null; + foreach (var value in list) + { + ConstantExpression constantExpression = Expression.Constant(value); + UnaryExpression unaryExpression = Expression.Convert(memberProperty, constantExpression.Type); + + body = body == null + ? Expression.Equal(unaryExpression, constantExpression) + : Expression.OrElse(body, Expression.Equal(unaryExpression, constantExpression)); + } + return Expression.Lambda<Func<T, bool>>(body, parameter); + } + + // object value = propertyValue; + ConstantExpression constant = proType.ToString() == "System.String" + ? Expression.Constant(propertyValue) : Expression.Constant(propertyValue.ToString().ChangeType(proType)); + + // DateTime鍙�夋嫨浜嗘棩鏈熺殑鏃跺�欒嚜鍔ㄥ湪缁撴潫鏃ユ湡鍔犱竴澶╋紝淇DateTime绫诲瀷浣跨敤鏃ユ湡鍖洪棿鏌ヨ鏃犳硶鏌ヨ鍒扮粨鏉熸棩鏈熺殑闂 + if ((proType == typeof(DateTime) || proType == typeof(DateTime?)) && expressionType == LinqExpressionType.LessThanOrEqual && propertyValue.ToString().Length == 10) + { + constant = Expression.Constant(Convert.ToDateTime(propertyValue.ToString()).AddDays(1)); + } + + UnaryExpression member = Expression.Convert(memberProperty, constant.Type); + Expression<Func<T, bool>> expression; + switch (expressionType) + { + //p=>p.propertyName == propertyValue + case LinqExpressionType.Equal: + expression = Expression.Lambda<Func<T, bool>>(Expression.Equal(member, constant), parameter); + break; + //p=>p.propertyName != propertyValue + case LinqExpressionType.NotEqual: + expression = Expression.Lambda<Func<T, bool>>(Expression.NotEqual(member, constant), parameter); + break; + // p => p.propertyName > propertyValue + case LinqExpressionType.GreaterThan: + expression = Expression.Lambda<Func<T, bool>>(Expression.GreaterThan(member, constant), parameter); + break; + // p => p.propertyName < propertyValue + case LinqExpressionType.LessThan: + expression = Expression.Lambda<Func<T, bool>>(Expression.LessThan(member, constant), parameter); + break; + // p => p.propertyName >= propertyValue + case LinqExpressionType.ThanOrEqual: + expression = Expression.Lambda<Func<T, bool>>(Expression.GreaterThanOrEqual(member, constant), parameter); + break; + // p => p.propertyName <= propertyValue + case LinqExpressionType.LessThanOrEqual: + expression = Expression.Lambda<Func<T, bool>>(Expression.LessThanOrEqual(member, constant), parameter); + break; + // p => p.propertyName.Contains(propertyValue) + // p => !p.propertyName.Contains(propertyValue) + case LinqExpressionType.Contains: + case LinqExpressionType.NotContains: + MethodInfo method = typeof(string).GetMethod("Contains", new[] { typeof(string) }); + constant = Expression.Constant(propertyValue, typeof(string)); + if (expressionType == LinqExpressionType.Contains) + { + expression = Expression.Lambda<Func<T, bool>>(Expression.Call(member, method, constant), parameter); + } + else + { + expression = Expression.Lambda<Func<T, bool>>(Expression.Not(Expression.Call(member, method, constant)), parameter); + } + break; + default: + // p => p.false + expression = False<T>(); + break; + } + return expression; + } + + /// <summary> + /// 鍒涘缓lambda琛ㄨ揪寮忥細p=>false + /// </summary> + /// <typeparam name="T"></typeparam> + /// <returns></returns> + public static Expression<Func<T, bool>> False<T>() + { + + return p => false; + } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Utilities/VierificationCode.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Utilities/VierificationCode.cs" new file mode 100644 index 0000000..bc8ad68 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Utilities/VierificationCode.cs" @@ -0,0 +1,123 @@ +锘縰sing SkiaSharp; +using System; +using System.Collections.Generic; +using System.Drawing; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using static log4net.Appender.ColoredConsoleAppender; + +namespace WIDESEA_Core.Utilities +{ + public static class VierificationCode + { + private static readonly string[] _chars = new string[] { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "P", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z" }; + + private static readonly SKColor[] colors = { SKColors.Black, SKColors.Green, SKColors.Brown }; + + private static readonly string[] fonts = { "Verdana", "Microsoft Sans Serif", "Comic Sans MS", "Arial", "瀹嬩綋" }; + public static string RandomText() + { + string code = "";//浜х敓鐨勯殢鏈烘暟 + int temp = -1; + Random rand = new Random(); + for (int i = 1; i < 5; i++) + { + if (temp != -1) + { + rand = new Random(i * temp * unchecked((int)DateTime.Now.Ticks)); + } + int t = rand.Next(61); + if (temp != -1 && temp == t) + { + return RandomText(); + } + temp = t; + code += _chars[t]; + } + return code; + } + public static string CreateBase64Imgage(string code) + { + var random = new Random(); + var info = new SKImageInfo((int)code.Length * 18, 32); + using var bitmap = new SKBitmap(info); + using var canvas = new SKCanvas(bitmap); + + canvas.Clear(SKColors.White); + + using var pen = new SKPaint(); + pen.FakeBoldText = true; + pen.Style = SKPaintStyle.Fill; + pen.TextSize = 20;// 0.6f * info.Width * pen.TextSize / pen.MeasureText(code); + + //缁樺埗闅忔満瀛楃 + for (int i = 0; i < code.Length; i++) + { + pen.Color = random.GetRandom(colors);//闅忔満棰滆壊绱㈠紩鍊� + + pen.Typeface = SKTypeface.FromFamilyName(random.GetRandom(fonts), 700, 20, SKFontStyleSlant.Italic);//閰嶇疆瀛椾綋 + var point = new SKPoint() + { + X = i * 16, + Y = 22// info.Height - ((i + 1) % 2 == 0 ? 2 : 4), + + }; + canvas.DrawText(code.Substring(i, 1), point, pen);//缁樺埗涓�涓獙璇佸瓧绗� + + } + + // 缁樺埗鍣偣 + var points = Enumerable.Range(0, 100).Select( + _ => new SKPoint(random.Next(bitmap.Width), random.Next(bitmap.Height)) + ).ToArray(); + canvas.DrawPoints( + SKPointMode.Points, + points, + pen); + + //缁樺埗璐濆灏旂嚎鏉� + for (int i = 0; i < 2; i++) + { + var p1 = new SKPoint(0, 0); + var p2 = new SKPoint(0, 0); + var p3 = new SKPoint(0, 0); + var p4 = new SKPoint(0, 0); + + var touchPoints = new SKPoint[] { p1, p2, p3, p4 }; + + using var bPen = new SKPaint(); + bPen.Color = random.GetRandom(colors); + bPen.Style = SKPaintStyle.Stroke; + + using var path = new SKPath(); + path.MoveTo(touchPoints[0]); + path.CubicTo(touchPoints[1], touchPoints[2], touchPoints[3]); + canvas.DrawPath(path, bPen); + } + return bitmap.ToBase64String(SKEncodedImageFormat.Png); + } + + public static T GetRandom<T>(this Random random, T[] tArray) + { + if (random == null) random = new Random(); + return tArray[random.Next(tArray.Length)]; + } + + /// <summary> + /// SKBitmap杞珺ase64String + /// </summary> + /// <param name="bitmap"></param> + /// <param name="format"></param> + /// <returns></returns> + public static string ToBase64String(this SKBitmap bitmap, SKEncodedImageFormat format) + { + using var memStream = new MemoryStream(); + using var wstream = new SKManagedWStream(memStream); + bitmap.Encode(wstream, format, 32); + memStream.TryGetBuffer(out ArraySegment<byte> buffer); + return $"{Convert.ToBase64String(buffer.Array, 0, (int)memStream.Length)}"; + } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_DTO/Basic/RequestTaskDto.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_DTO/Basic/RequestTaskDto.cs" new file mode 100644 index 0000000..0fa5ef5 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_DTO/Basic/RequestTaskDto.cs" @@ -0,0 +1,41 @@ +锘縩amespace WIDESEA_DTO; + +public class RequestTaskDto +{ + /// <summary> + /// 褰撳墠浣嶇疆 + /// </summary> + public string Position { get; set; } + + /// <summary> + /// 鎵樼洏鍙� + /// </summary> + public string PalletCode { get; set; } + + /// <summary> + /// 绌烘墭鐩樺彲鍏ュ贩鍒� + /// </summary> + public string PositionList { get; set; } + /// <summary> + /// 浠诲姟绫诲瀷 + /// </summary> + public string RequestType { get; set; } = string.Empty; + + public string Roadways { get; set; } + + public int taskNum { get; set; } + + /// <summary> + /// 杞﹁酱鏉$爜 + /// </summary> + //public string cztm { get; set; } +} + +public class RequestOutTaskDto +{ + public string Position { get; set; } + public int Tag { get; set; } + public string AreaCdoe { get; set; } + public List<string> AreaCdoes { get; set; } + public string ProductionLine { get; set; } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_DTO/Basic/UpdateStatusDto.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_DTO/Basic/UpdateStatusDto.cs" new file mode 100644 index 0000000..2b109c5 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_DTO/Basic/UpdateStatusDto.cs" @@ -0,0 +1,21 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WIDESEA_DTO +{ + public class UpdateStatusDto + { + /// <summary> + /// 浠诲姟鍙� + /// </summary> + public int TaskNum { get; set; } + + /// <summary> + /// 浠诲姟鐘舵�� + /// </summary> + public int TaskState { get; set; } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_DTO/Location/LocationChangeRecordDto.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_DTO/Location/LocationChangeRecordDto.cs" new file mode 100644 index 0000000..9797c58 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_DTO/Location/LocationChangeRecordDto.cs" @@ -0,0 +1,35 @@ +锘縩amespace WIDESEA_DTO +{ + public class LocationChangeRecordDto + { + /// <summary> + /// 璐т綅缂栫爜 + /// </summary> + public string LocationCode { get; set; } + + /// <summary> + /// 璐т綅ID + /// </summary> + public int LocationId { get; set; } + + /// <summary> + /// 鍙樻洿鍓嶇姸鎬� + /// </summary> + public int BeforeStatus { get; set; } + + /// <summary> + /// 鍙樻洿鍚庣姸鎬� + /// </summary> + public int AfterStatus { get; set; } + + /// <summary> + /// 鍙樻洿绫诲瀷 + /// </summary> + public int ChangeType { get; set; } + + /// <summary> + /// 璐т綅缂栫爜 + /// </summary> + public int TaskNum { get; set; } = 0; + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_DTO/MCS/NotifyFinishTest.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_DTO/MCS/NotifyFinishTest.cs" new file mode 100644 index 0000000..77a1d6b --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_DTO/MCS/NotifyFinishTest.cs" @@ -0,0 +1,32 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WIDESEA_DTO +{ + public class NotifyFinishTest + { + /// <summary> + /// 搴撳尯 + /// </summary> + public int LocationArea { get; set; } + + /// <summary> + /// 鎵樼洏鍙� + /// </summary> + public string PalletBarcode { get; set; } + + /// <summary> + /// 搴撲綅鍙� + /// </summary> + public string LocationID { get; set; } + + /// <summary> + /// 鏄惁瀛樺湪NG (1-鏈�;2-鏃�) + /// </summary> + public int IsNG { get; set; } + + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_DTO/MCS/NotityInFinish.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_DTO/MCS/NotityInFinish.cs" new file mode 100644 index 0000000..650963a --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_DTO/MCS/NotityInFinish.cs" @@ -0,0 +1,27 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WIDESEA_DTO +{ + public class NotityInFinish + { + /// <summary> + /// 搴撳尯 + /// </summary> + public int LocationArea { get; set; } + + /// <summary> + /// 鎵樼洏鍙� + /// </summary> + public string PalletBarcode { get; set; } + + /// <summary> + /// 搴撲綅鍙� + /// </summary> + public string LocationID { get; set; } + + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_DTO/MCS/RequestReMove.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_DTO/MCS/RequestReMove.cs" new file mode 100644 index 0000000..43695b1 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_DTO/MCS/RequestReMove.cs" @@ -0,0 +1,32 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WIDESEA_DTO +{ + public class RequestReMove + { + /// <summary> + /// 搴撳尯 + /// </summary> + public int LocationArea { get; set; } + + /// <summary> + /// 鎵樼洏鍙� + /// </summary> + public string PalletBarcode { get; set; } + + /// <summary> + /// 搴撲綅鍙� + /// </summary> + public string LocationID { get; set; } + + /// <summary> + /// 绉诲簱绫诲瀷(1-姝e父绉诲簱/妫�淇Щ搴� 2-杞Щ鍒板紓甯歌涪鍑哄彛(绉诲叆Ng绔�) 5-娑堥槻绉诲簱(鐏)) + /// </summary> + public int MoveType { get; set; } + + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_DTO/MCS/RequsetCellInfo.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_DTO/MCS/RequsetCellInfo.cs" new file mode 100644 index 0000000..d57d1c5 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_DTO/MCS/RequsetCellInfo.cs" @@ -0,0 +1,24 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WIDESEA_DTO +{ + /// <summary> + /// 璇锋眰搴撲綅淇℃伅 + /// </summary> + public class RequsetCellInfo + { + /// <summary> + /// 搴撳尯 + /// </summary> + public int LocationArea { get; set; } + + /// <summary> + /// 搴撲綅鍙� + /// </summary> + public string LocationID { get; set; } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_DTO/MCS/WorkState.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_DTO/MCS/WorkState.cs" new file mode 100644 index 0000000..af63fe9 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_DTO/MCS/WorkState.cs" @@ -0,0 +1,31 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WIDESEA_DTO +{ + public class WorkState + { + /// <summary> + /// 搴撲綅鏁版嵁锛堝純鐢�,2024骞�11鏈�5鏃ラ潰璋� 灏嗛泦鍚堝簱浣嶆暟鎹敼涓哄崟涓簱浣嶆暟鎹悓姝ワ級 + /// </summary> + public List<LocationWorkState> workStates { get; set; } + } + + public class LocationWorkState + { + public int LocationArea { get; set; } + + /// <summary> + /// 鐘舵�� + /// </summary> + public int StateCode { get; set; } + + /// <summary> + /// 搴撲綅缂栧彿 + /// </summary> + public string LocationID { get; set; } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_DTO/RoadWayDTO.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_DTO/RoadWayDTO.cs" new file mode 100644 index 0000000..043d82c --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_DTO/RoadWayDTO.cs" @@ -0,0 +1,34 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WIDESEA_DTO +{ + /// <summary> + /// 绛涢�夊贩閬� + /// </summary> + public class RoadWayDTO + { + /// <summary> + /// 宸烽亾缂栧彿 + /// </summary> + public string? RoadWayNO { get; set; } + + /// <summary> + /// 璐т綅绌洪棽鏁� + /// </summary> + public int FreeLocationCount { get; set; } + + /// <summary> + /// 宸烽亾褰撳墠浠诲姟鏁� + /// </summary> + public int TaskCount { get; set; } + + /// <summary> + /// 棰勮璐т綅绌洪棽鏁� 锛堣揣浣嶇┖闂叉暟-宸烽亾褰撳墠浠诲姟鏁帮級 + /// </summary> + public int PreFreeLocationCount { get; set; } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_DTO/System/ActionDTO.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_DTO/System/ActionDTO.cs" new file mode 100644 index 0000000..57ed299 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_DTO/System/ActionDTO.cs" @@ -0,0 +1,16 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WIDESEA_DTO.System +{ + public class ActionDTO + { + public int ActionId { get; set; } + public int MenuId { get; set; } + public string Text { get; set; } + public string Value { get; set; } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_DTO/System/MenuDTO.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_DTO/System/MenuDTO.cs" new file mode 100644 index 0000000..44d8bde --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_DTO/System/MenuDTO.cs" @@ -0,0 +1,14 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Model.Models; + +namespace WIDESEA_DTO.System +{ + public class MenuDTO : Sys_Menu + { + public List<ActionDTO> Actions { get; set; } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_DTO/System/RegistrationDTO.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_DTO/System/RegistrationDTO.cs" new file mode 100644 index 0000000..832a635 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_DTO/System/RegistrationDTO.cs" @@ -0,0 +1,13 @@ +锘縩amespace WIDESEA_DTO.System +{ + public class RegistrationDTO + { + public string CompanyName { get; set; } + public string CompanyType { get; set; } + public string Industry { get; set; } + public string ContactName { get; set; } + public string ContactPhone { get; set; } + public string ContactEmail { get; set; } + public bool AgreeTerms { get; set; } + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_DTO/System/UserPermissions.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_DTO/System/UserPermissions.cs" new file mode 100644 index 0000000..9c892bb --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_DTO/System/UserPermissions.cs" @@ -0,0 +1,17 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WIDESEA_DTO.System +{ + public class UserPermissionDTO + { + public int Id { get; set; } + public int Pid { get; set; } + public string Text { get; set; } + public bool IsApp { get; set; } + public List<ActionDTO> Actions { get; set; } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_DTO/WCS/Dt_DeviceInfo.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_DTO/WCS/Dt_DeviceInfo.cs" new file mode 100644 index 0000000..74eb4f8 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_DTO/WCS/Dt_DeviceInfo.cs" @@ -0,0 +1,104 @@ +锘�#region << 鐗� 鏈� 娉� 閲� >> + +/*---------------------------------------------------------------- + * 鍛藉悕绌洪棿锛歐IDESEAWCS_QuartzJob + * 鍒涘缓鑰咃細鑳$搴� + * 鍒涘缓鏃堕棿锛�2024/8/2 16:13:36 + * 鐗堟湰锛歏1.0.0 + * 鎻忚堪锛氳澶囦俊鎭疄浣� + * + * ---------------------------------------------------------------- + * 淇敼浜猴細 + * 淇敼鏃堕棿锛� + * 鐗堟湰锛歏1.0.1 + * 淇敼璇存槑锛� + * + *----------------------------------------------------------------*/ + +#endregion << 鐗� 鏈� 娉� 閲� >> + +using Magicodes.ExporterAndImporter.Core; +using SqlSugar; +using WIDESEA_Core.DB.Models; + +namespace WIDESEAWCS_QuartzJob.Models +{ + /// <summary> + /// 璁惧淇℃伅 + /// </summary> + [SugarTable(nameof(Dt_DeviceInfo), "璁惧淇℃伅")] + public class Dt_DeviceInfo : BaseEntity + { + /// <summary> + /// 涓婚敭 + /// </summary> + [ImporterHeader(IsIgnore = true)] + [ExporterHeader(DisplayName = "涓婚敭")] + [SugarColumn(IsIdentity = true, IsPrimaryKey = true, ColumnDescription = "涓婚敭")] + public int Id { get; set; } + + /// <summary> + /// 璁惧缂栧彿 + /// </summary> + [ImporterHeader(Name = "璁惧缂栧彿")] + [ExporterHeader(DisplayName = "璁惧缂栧彿")] + [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "璁惧缂栧彿")] + public string DeviceCode { get; set; } + + /// <summary> + /// 璁惧鍚嶇О + /// </summary> + [ImporterHeader(Name = "璁惧鍚嶇О")] + [ExporterHeader(DisplayName = "璁惧鍚嶇О")] + [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "璁惧鍚嶇О")] + public string DeviceName { get; set; } + + /// <summary> + /// 璁惧绫诲瀷 + /// </summary> + [ImporterHeader(Name = "璁惧绫诲瀷")] + [ExporterHeader(DisplayName = "璁惧绫诲瀷")] + [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "璁惧绫诲瀷")] + public string DeviceType { get; set; } + + /// <summary> + /// 璁惧鐘舵�� + /// </summary> + [ImporterHeader(Name = "璁惧鐘舵��")] + [ExporterHeader(DisplayName = "璁惧鐘舵��")] + [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "璁惧鐘舵��")] + public string DeviceStatus { get; set; } + + /// <summary> + /// 璁惧IP + /// </summary> + [ImporterHeader(Name = "璁惧IP")] + [ExporterHeader(DisplayName = "璁惧IP")] + [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "璁惧IP")] + public string DeviceIp { get; set; } + + /// <summary> + /// 璁惧绔彛 + /// </summary> + [ImporterHeader(Name = "璁惧绔彛")] + [ExporterHeader(DisplayName = "璁惧绔彛")] + [SugarColumn(IsNullable = false, ColumnDescription = "璁惧绔彛")] + public int DevicePort { get; set; } + + /// <summary> + /// PLC绫诲瀷 + /// </summary> + [ImporterHeader(Name = "PLC绫诲瀷")] + [ExporterHeader(DisplayName = "PLC绫诲瀷")] + [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "PLC绫诲瀷")] + public string DevicePlcType { get; set; } + + /// <summary> + /// 澶囨敞 + /// </summary> + [ImporterHeader(Name = "澶囨敞")] + [ExporterHeader(DisplayName = "澶囨敞")] + [SugarColumn(Length = 200, IsNullable = true, ColumnDescription = "澶囨敞")] + public string DeviceRemark { get; set; } + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_DTO/WCS/dt_needBarcode.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_DTO/WCS/dt_needBarcode.cs" new file mode 100644 index 0000000..d41d616 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_DTO/WCS/dt_needBarcode.cs" @@ -0,0 +1,59 @@ +锘縰sing SqlSugar; +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Text; + +namespace WIDESEA_DTO +{ + [SugarTable(nameof(dt_needBarcode), "鍦ㄩ�旀暟鎹�")] + public class dt_needBarcode + { + [Key] + [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "涓婚敭")] + public int id { get; set; } + + /// <summary> + /// 鐩爣搴撳尯 + /// </summary> + [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "鐩爣搴撳尯")] + public string toArea { get; set; } + + /// <summary> + /// 鏉ユ簮搴撳尯 + /// </summary> + [SugarColumn(IsNullable = false, Length = 10, ColumnDescription = "鏉ユ簮搴撳尯")] + public string fromArea { get; set; } + + /// <summary> + /// 鎵樼洏绫诲瀷 + /// </summary> + [SugarColumn(IsNullable = false, Length = 10, ColumnDescription = "鎵樼洏绫诲瀷")] + public string barcodeType { get; set; } + + /// <summary> + /// 浜х嚎 + /// </summary> + [SugarColumn(IsNullable = false, Length = 10, ColumnDescription = "鎵�灞炰骇绾�")] + public string productLine { get; set; } + + /// <summary> + /// 鍦ㄩ�旀暟閲� + /// </summary> + [SugarColumn(IsNullable = false, Length = 10, ColumnDescription = "鍦ㄩ�旀暟閲�")] + public int inLineNum { get; set; } + + /// <summary> + /// 鐩爣缂撳瓨鏁伴噺 + /// </summary> + [SugarColumn(IsNullable = false, Length = 10, ColumnDescription = "鍙紦瀛樻暟閲�")] + public int cacheNum { get; set; } = 0; + + /// <summary> + /// 宸插垱寤哄嚭搴撲换鍔℃暟閲� + /// </summary> + //[NotMapped] + //public int haveOutNum { get; set; } = 0; + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_DTO/WMS/OutBoundMateriel.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_DTO/WMS/OutBoundMateriel.cs" new file mode 100644 index 0000000..1e4c34d --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_DTO/WMS/OutBoundMateriel.cs" @@ -0,0 +1,15 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WIDESEA_DTO.WMS +{ + public class OutBoundMateriel + { + public string MaterielCode { get; set; } + public string ProductionLine { get; set; } + public string ProcessCode { get; set; } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_DTO/WMS/WMSTaskDTO.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_DTO/WMS/WMSTaskDTO.cs" new file mode 100644 index 0000000..a65788f --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_DTO/WMS/WMSTaskDTO.cs" @@ -0,0 +1,87 @@ +锘縰sing SqlSugar; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WIDESEA_DTO.WMS +{ + public class WMSTaskDTO + { + /// <summary> + /// WMS浠诲姟涓婚敭 + /// </summary> + public int Id { get; set; } + + /// <summary> + /// 浠诲姟鍙� + /// </summary> + public int TaskNum { get; set; } + + /// <summary> + /// 鎵樼洏鍙� + /// </summary> + public string PalletCode { get; set; } + + /// <summary> + /// 宸烽亾鍙� + /// </summary> + public string RoadWay { get; set; } + + /// <summary> + /// 浠诲姟绫诲瀷 + /// </summary> + public int TaskType { get; set; } + + /// <summary> + /// 浠诲姟鐘舵�� + /// </summary> + public int TaskState { get; set; } + + /// <summary> + /// 璧风偣 + /// </summary> + public string SourceAddress { get; set; } + + /// <summary> + /// 缁堢偣 + /// </summary> + public string TargetAddress { get; set; } + + /// <summary> + /// 浼樺厛绾� + /// </summary> + public int Grade { get; set; } + + /// <summary> + /// 鏄惁妫�娴� + /// </summary> + public bool IsCheck { get; set; } + + /// <summary> + /// 杞﹀瀷 + /// </summary> + public string CarType { get; set; } + + /// <summary> + /// 杞緞鍊� + /// </summary> + public string wheels_gkcc { get; set; } + + /// <summary> + /// 鏂版棫 + /// </summary> + public string WheelsNewOrOld { get; set; } + + /// <summary> + /// 鍔ㄦ嫋灞炴�� + /// </summary> + public string wheels_mttype { get; set; } + + /// <summary> + /// 杞瀷 + /// </summary> + public string WheelsLX { get; set; } + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IBusinessServices/Dt_RoadWayInfoService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IBusinessServices/Dt_RoadWayInfoService.cs" new file mode 100644 index 0000000..083aa50 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IBusinessServices/Dt_RoadWayInfoService.cs" @@ -0,0 +1,14 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Core.BaseServices; +using WIDESEA_Model.Models; + +namespace WIDESEA_IBusinessServices +{ + public interface IDt_RoadWayInfoService : IService<Dt_RoadWayInfo> + { + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IBusinessServices/IDt_AreaInfoService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IBusinessServices/IDt_AreaInfoService.cs" new file mode 100644 index 0000000..a749e36 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IBusinessServices/IDt_AreaInfoService.cs" @@ -0,0 +1,14 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Core.BaseServices; +using WIDESEA_Model.Models; + +namespace WIDESEA_IBusinessServices +{ + public interface IDt_AreaInfoService : IService<Dt_AreaInfo> + { + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IBusinessServices/IDt_MaterielAttributeService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IBusinessServices/IDt_MaterielAttributeService.cs" new file mode 100644 index 0000000..c49e600 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IBusinessServices/IDt_MaterielAttributeService.cs" @@ -0,0 +1,13 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Core.BaseServices; +using WIDESEA_Model.Models; +namespace WIDESEA_IBusinessServices +{ + public interface IDt_MaterielAttributeService : IService<Dt_MaterielAttribute> + { + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IBusinessServices/IDt_MaterielInfoService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IBusinessServices/IDt_MaterielInfoService.cs" new file mode 100644 index 0000000..4e11e6e --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IBusinessServices/IDt_MaterielInfoService.cs" @@ -0,0 +1,14 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Core.BaseServices; +using WIDESEA_Model.Models; + +namespace WIDESEA_IBusinessServices +{ + public interface IDt_MaterielInfoService : IService<Dt_MaterielInfo> + { + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IBusinessServices/IDt_StrategyService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IBusinessServices/IDt_StrategyService.cs" new file mode 100644 index 0000000..f3e491c --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IBusinessServices/IDt_StrategyService.cs" @@ -0,0 +1,14 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Core.BaseServices; +using WIDESEA_Model.Models; + +namespace WIDESEA_IBusinessServices +{ + public interface IDt_StrategyService : IService<Dt_Strategy> + { + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IBusinessServices/IDt_TaskExecuteDetailService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IBusinessServices/IDt_TaskExecuteDetailService.cs" new file mode 100644 index 0000000..c1ae710 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IBusinessServices/IDt_TaskExecuteDetailService.cs" @@ -0,0 +1,14 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Core.BaseServices; +using WIDESEA_Model.Models; + +namespace WIDESEA_IBusinessServices +{ + public interface IDt_TaskExecuteDetailService : IService<Dt_TaskExecuteDetail> + { + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IBusinessServices/IDt_TypeMappingService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IBusinessServices/IDt_TypeMappingService.cs" new file mode 100644 index 0000000..4825713 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IBusinessServices/IDt_TypeMappingService.cs" @@ -0,0 +1,14 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Core.BaseServices; +using WIDESEA_Model.Models; + +namespace WIDESEA_IBusinessServices +{ + public interface IDt_TypeMappingService : IService<Dt_TypeMapping> + { + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IBusinessServices/IDt_UnitInfoService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IBusinessServices/IDt_UnitInfoService.cs" new file mode 100644 index 0000000..44435b0 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IBusinessServices/IDt_UnitInfoService.cs" @@ -0,0 +1,14 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Core.BaseServices; +using WIDESEA_Model.Models; + +namespace WIDESEA_IBusinessServices +{ + public interface IDt_UnitInfoService : IService<Dt_UnitInfo> + { + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IBusinessServices/IDt_WareAreaInfoService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IBusinessServices/IDt_WareAreaInfoService.cs" new file mode 100644 index 0000000..1c81769 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IBusinessServices/IDt_WareAreaInfoService.cs" @@ -0,0 +1,13 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Core.BaseServices; +using WIDESEA_Model.Models; +namespace WIDESEA_IBusinessServices +{ + public interface IDt_WareAreaInfoService : IService<Dt_WareAreaInfo> + { + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IBusinessesRepository/IDt_AreaInfoRepository.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IBusinessesRepository/IDt_AreaInfoRepository.cs" new file mode 100644 index 0000000..c52cff3 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IBusinessesRepository/IDt_AreaInfoRepository.cs" @@ -0,0 +1,14 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Core.BaseRepository; +using WIDESEA_Model.Models; + +namespace WIDESEA_IBusinessesRepository +{ + public interface IDt_AreaInfoRepository : IRepository<Dt_AreaInfo> + { + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IBusinessesRepository/IDt_MaterielAttributeRepository.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IBusinessesRepository/IDt_MaterielAttributeRepository.cs" new file mode 100644 index 0000000..aa86d4d --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IBusinessesRepository/IDt_MaterielAttributeRepository.cs" @@ -0,0 +1,14 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Core.BaseRepository; +using WIDESEA_Model.Models; + +namespace WIDESEA_IBusinessesRepository +{ + public interface IDt_MaterielAttributeRepository : IRepository<Dt_MaterielAttribute> + { + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IBusinessesRepository/IDt_MaterielInfoRepository.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IBusinessesRepository/IDt_MaterielInfoRepository.cs" new file mode 100644 index 0000000..31011c8 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IBusinessesRepository/IDt_MaterielInfoRepository.cs" @@ -0,0 +1,14 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Core.BaseRepository; +using WIDESEA_Model.Models; + +namespace WIDESEA_IBusinessesRepository +{ + public interface IDt_MaterielInfoRepository : IRepository<Dt_MaterielInfo> + { + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IBusinessesRepository/IDt_RoadWayInfoRepository.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IBusinessesRepository/IDt_RoadWayInfoRepository.cs" new file mode 100644 index 0000000..96438c7 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IBusinessesRepository/IDt_RoadWayInfoRepository.cs" @@ -0,0 +1,14 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Core.BaseRepository; +using WIDESEA_Model.Models; + +namespace WIDESEA_IBusinessesRepository +{ + public interface IDt_RoadWayInfoRepository : IRepository<Dt_RoadWayInfo> + { + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IBusinessesRepository/IDt_StrategyRepository.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IBusinessesRepository/IDt_StrategyRepository.cs" new file mode 100644 index 0000000..0f7e47c --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IBusinessesRepository/IDt_StrategyRepository.cs" @@ -0,0 +1,14 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Core.BaseRepository; +using WIDESEA_Model.Models; + +namespace WIDESEA_IBusinessesRepository +{ + public interface IDt_StrategyRepository : IRepository<Dt_Strategy> + { + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IBusinessesRepository/IDt_TaskExecuteDetailRepository.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IBusinessesRepository/IDt_TaskExecuteDetailRepository.cs" new file mode 100644 index 0000000..47f8907 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IBusinessesRepository/IDt_TaskExecuteDetailRepository.cs" @@ -0,0 +1,14 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Core.BaseRepository; +using WIDESEA_Model.Models; + +namespace WIDESEA_IBusinessesRepository +{ + public interface IDt_TaskExecuteDetailRepository : IRepository<Dt_TaskExecuteDetail> + { + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IBusinessesRepository/IDt_TypeMappingRepository.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IBusinessesRepository/IDt_TypeMappingRepository.cs" new file mode 100644 index 0000000..a9dae73 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IBusinessesRepository/IDt_TypeMappingRepository.cs" @@ -0,0 +1,14 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Core.BaseRepository; +using WIDESEA_Model.Models; + +namespace WIDESEA_IBusinessesRepository +{ + public interface IDt_TypeMappingRepository : IRepository<Dt_TypeMapping> + { + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IBusinessesRepository/IDt_UnitInfoRepository.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IBusinessesRepository/IDt_UnitInfoRepository.cs" new file mode 100644 index 0000000..374aff6 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IBusinessesRepository/IDt_UnitInfoRepository.cs" @@ -0,0 +1,14 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Core.BaseRepository; +using WIDESEA_Model.Models; + +namespace WIDESEA_IBusinessesRepository +{ + public interface IDt_UnitInfoRepository : IRepository<Dt_UnitInfo> + { + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IBusinessesRepository/IDt_WareAreaInfoRepository.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IBusinessesRepository/IDt_WareAreaInfoRepository.cs" new file mode 100644 index 0000000..0da5d6c --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IBusinessesRepository/IDt_WareAreaInfoRepository.cs" @@ -0,0 +1,14 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Core.BaseRepository; +using WIDESEA_Model.Models; + +namespace WIDESEA_IBusinessesRepository +{ + public interface IDt_WareAreaInfoRepository : IRepository<Dt_WareAreaInfo> + { + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IRepository/ISys_CompanyRegistrationRepository.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IRepository/ISys_CompanyRegistrationRepository.cs" new file mode 100644 index 0000000..fddd691 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IRepository/ISys_CompanyRegistrationRepository.cs" @@ -0,0 +1,14 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Core.BaseRepository; +using WIDESEA_Core.HttpContextUser; +using WIDESEA_Model.Models; + +namespace WIDESEA_IRepository; + +public interface ISys_CompanyRegistrationRepository : IRepository<Sys_CompanyRegistration> +{ +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IRepository/ISys_ConfigRepository.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IRepository/ISys_ConfigRepository.cs" new file mode 100644 index 0000000..9a643cd --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IRepository/ISys_ConfigRepository.cs" @@ -0,0 +1,15 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Core.BaseRepository; +using WIDESEA_Core.HttpContextUser; +using WIDESEA_Model.Models; + +namespace WIDESEA_IRepository +{ + public interface ISys_ConfigRepository : IRepository<Sys_Config> + { + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IRepository/ISys_DictionaryRepository.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IRepository/ISys_DictionaryRepository.cs" new file mode 100644 index 0000000..8a10124 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IRepository/ISys_DictionaryRepository.cs" @@ -0,0 +1,15 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Core.BaseRepository; +using WIDESEA_Model.Models; + +namespace WIDESEA_IRepository +{ + public interface ISys_DictionaryRepository : IRepository<Sys_Dictionary> + { + IEnumerable<Sys_Dictionary> GetDictionaries(IEnumerable<string> dicNos, bool executeSql = true); + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IRepository/ISys_MenuRepository.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IRepository/ISys_MenuRepository.cs" new file mode 100644 index 0000000..6e6af38 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IRepository/ISys_MenuRepository.cs" @@ -0,0 +1,27 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Core; +using WIDESEA_Core.BaseRepository; +using WIDESEA_DTO.System; +using WIDESEA_Model.Models; + +namespace WIDESEA_IRepository +{ + public interface ISys_MenuRepository : IRepository<Sys_Menu> + { + List<MenuDTO> GetAllMenu(); + + object GetSuperAdminMenu(); + + object GetMenuByRoleId(int roleId); + + List<Permissions> GetPermissions(int roleId); + + object GetMenu(List<int> menuIds); + + object GetTreeItem(int menuId); + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IRepository/ISys_RoleAuthRepository.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IRepository/ISys_RoleAuthRepository.cs" new file mode 100644 index 0000000..5825b44 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IRepository/ISys_RoleAuthRepository.cs" @@ -0,0 +1,14 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Core.BaseRepository; +using WIDESEA_Model.Models; + +namespace WIDESEA_IRepository +{ + public interface ISys_RoleAuthRepository : IRepository<Sys_RoleAuth> + { + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IRepository/ISys_RoleRepository.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IRepository/ISys_RoleRepository.cs" new file mode 100644 index 0000000..1247e3d --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IRepository/ISys_RoleRepository.cs" @@ -0,0 +1,14 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Core.BaseRepository; +using WIDESEA_Model.Models; + +namespace WIDESEA_IRepository +{ + public interface ISys_RoleRepository : IRepository<Sys_Role> + { + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IRepository/ISys_TenantRepository.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IRepository/ISys_TenantRepository.cs" new file mode 100644 index 0000000..401e256 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IRepository/ISys_TenantRepository.cs" @@ -0,0 +1,14 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Core.BaseRepository; +using WIDESEA_Model.Models; + +namespace WIDESEA_IRepository +{ + public interface ISys_TenantRepository : IRepository<Sys_Tenant> + { + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IRepository/ISys_TestRepository.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IRepository/ISys_TestRepository.cs" new file mode 100644 index 0000000..246cede --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IRepository/ISys_TestRepository.cs" @@ -0,0 +1,14 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Core.BaseRepository; +using WIDESEA_Model.Models; + +namespace WIDESEA_IRepository +{ + public interface ISys_TestRepository : IRepository<Sys_Test> + { + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IRepository/ISys_UserRepository.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IRepository/ISys_UserRepository.cs" new file mode 100644 index 0000000..577c4fb --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IRepository/ISys_UserRepository.cs" @@ -0,0 +1,16 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Core.BaseRepository; +using WIDESEA_Core.HttpContextUser; +using WIDESEA_Model.Models; + +namespace WIDESEA_IRepository +{ + public interface ISys_UserRepository : IRepository<Sys_User> + { + UserInfo GetUserInfo(string userName, string password); + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IServices/ISys_CompanyRegistrationService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IServices/ISys_CompanyRegistrationService.cs" new file mode 100644 index 0000000..3c96465 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IServices/ISys_CompanyRegistrationService.cs" @@ -0,0 +1,12 @@ +锘縰sing Autofac.Builder; +using WIDESEA_Core; +using WIDESEA_Core.BaseServices; +using WIDESEA_DTO.System; +using WIDESEA_Model.Models; + +namespace WIDESEA_IServices; + +public interface ISys_CompanyRegistrationService : IService<Sys_CompanyRegistration> +{ + WebResponseContent RegisterCompany(RegistrationDTO registration); +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IServices/ISys_ConfigService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IServices/ISys_ConfigService.cs" new file mode 100644 index 0000000..db2d913 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IServices/ISys_ConfigService.cs" @@ -0,0 +1,37 @@ +锘縰sing Microsoft.AspNetCore.Mvc; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Core; +using WIDESEA_Core.BaseServices; +using WIDESEA_Model; +using WIDESEA_Model.Models; + +namespace WIDESEA_IServices +{ + public interface ISys_ConfigService : IService<Sys_Config> + { + /// <summary> + /// 鑾峰彇鎵�鏈夌郴缁熼厤缃� + /// </summary> + /// <returns></returns> + List<Sys_Config> GetAll(); + + /// <summary> + /// 鏍规嵁绫诲埆鑾峰彇绯荤粺閰嶇疆 + /// </summary> + /// <param name="category">绫诲埆</param> + /// <returns></returns> + List<Sys_Config> GetConfigsByCategory(string category); + + /// <summary> + /// 鏍规嵁绫诲埆鍜孠ey鑾峰彇绯荤粺閰嶇疆 + /// </summary> + /// <param name="category">绫诲埆</param> + /// <param name="configKey">閰嶇疆Key</param> + /// <returns></returns> + Sys_Config GetByConfigKey(string category, string configKey); + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IServices/ISys_DictionaryService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IServices/ISys_DictionaryService.cs" new file mode 100644 index 0000000..9bf55c4 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IServices/ISys_DictionaryService.cs" @@ -0,0 +1,15 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Core.BaseServices; +using WIDESEA_Model.Models; + +namespace WIDESEA_IServices +{ + public interface ISys_DictionaryService : IService<Sys_Dictionary> + { + object GetVueDictionary(string[] dicNos); + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IServices/ISys_MenuService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IServices/ISys_MenuService.cs" new file mode 100644 index 0000000..64d8daa --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IServices/ISys_MenuService.cs" @@ -0,0 +1,29 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Core; +using WIDESEA_Core.BaseServices; +using WIDESEA_DTO.System; +using WIDESEA_Model.Models; + +namespace WIDESEA_IServices +{ + public interface ISys_MenuService : IService<Sys_Menu> + { + object GetCurrentMenuActionList(); + + object GetCurrentMenuPhoneActionList(); + + List<MenuDTO> GetUserMenuList(int roleId); + + List<ActionDTO> GetActions(int menuId, List<ActionDTO> menuActions, List<Permissions> permissions, int roleId); + + object GetMenu(); + + object GetTreeItem(int menuId); + + WebResponseContent Save(Sys_Menu menu); + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IServices/ISys_RoleService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IServices/ISys_RoleService.cs" new file mode 100644 index 0000000..1fdd979 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IServices/ISys_RoleService.cs" @@ -0,0 +1,23 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Core; +using WIDESEA_Core.BaseServices; +using WIDESEA_DTO.System; +using WIDESEA_Model.Models; +using WIDESEA_Model.Models.System; + +namespace WIDESEA_IServices +{ + public interface ISys_RoleService : IService<Sys_Role> + { + List<RoleNodes> GetAllChildren(int roleId); + WebResponseContent GetCurrentTreePermission(); + + WebResponseContent GetUserTreePermission(int role_Id); + + WebResponseContent SavePermission(List<UserPermissionDTO> userPermissions, int roleId); + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IServices/ISys_TenantService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IServices/ISys_TenantService.cs" new file mode 100644 index 0000000..b3bbb8a --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IServices/ISys_TenantService.cs" @@ -0,0 +1,16 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Core; +using WIDESEA_Core.BaseServices; +using WIDESEA_Model.Models; + +namespace WIDESEA_IServices +{ + public interface ISys_TenantService : IService<Sys_Tenant> + { + WebResponseContent InitTenantInfo(string tenantName, int tenantType); + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IServices/ISys_TestService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IServices/ISys_TestService.cs" new file mode 100644 index 0000000..e4f9568 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IServices/ISys_TestService.cs" @@ -0,0 +1,16 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Core; +using WIDESEA_Core.BaseServices; +using WIDESEA_Model.Models; + +namespace WIDESEA_IServices +{ + public interface ISys_TestService : IService<Sys_Test> + { + WebResponseContent TranTest(); + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IServices/ISys_UserService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IServices/ISys_UserService.cs" new file mode 100644 index 0000000..84cf898 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IServices/ISys_UserService.cs" @@ -0,0 +1,24 @@ +锘縰sing Microsoft.AspNetCore.Mvc; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Core; +using WIDESEA_Core.BaseServices; +using WIDESEA_Model; +using WIDESEA_Model.Models; + +namespace WIDESEA_IServices +{ + public interface ISys_UserService : IService<Sys_User> + { + WebResponseContent Login(LoginInfo loginInfo); + + WebResponseContent GetCurrentUserInfo(); + + WebResponseContent ModifyPwd(string oldPwd, string newPwd); + WebResponseContent ModifyUserPwd(string password, string userName); + WebResponseContent UpdateInfo(int user_Id, string roleName, string userName, string userTrueName, string address, int gender, string remark); + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStoragIntegrationServices/MCS/IMCSService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStoragIntegrationServices/MCS/IMCSService.cs" new file mode 100644 index 0000000..db2c587 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStoragIntegrationServices/MCS/IMCSService.cs" @@ -0,0 +1,20 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Core; + +namespace WIDESEA_IStoragIntegrationServices +{ + public interface IMCSService : IDependency + { + WebResponseContent NotifyFinishTest(object json); + + WebResponseContent RequestChangeLocation(object json); + + WebResponseContent ModifyAccessStatus(object json); + + object RequsetCellInfo(object json); + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStoragIntegrationServices/ToAPP/IToAPPService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStoragIntegrationServices/ToAPP/IToAPPService.cs" new file mode 100644 index 0000000..d2d430b --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStoragIntegrationServices/ToAPP/IToAPPService.cs" @@ -0,0 +1,17 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Common; +using WIDESEA_Core; + +namespace WIDESEA_IStoragIntegrationServices +{ + public interface IToAPPService : IDependency + { + WebResponseContent SaveCLinfo(SaveModel saveModel); + + WebResponseContent SaveCZInfo(SaveModel saveModel); + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStoragIntegrationServices/ToCheckEquip/IToCheckService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStoragIntegrationServices/ToCheckEquip/IToCheckService.cs" new file mode 100644 index 0000000..306f0e0 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStoragIntegrationServices/ToCheckEquip/IToCheckService.cs" @@ -0,0 +1,17 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Common; +using WIDESEA_Core; + +namespace WIDESEA_IStoragIntegrationServices +{ + public interface IToCheckService : IDependency + { + WebResponseContent GetCheckInfo(object jsondata); + + WebResponseContent UploadCheckResult(object jsondata); + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStoragIntegrationServices/WCS/IWCSService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStoragIntegrationServices/WCS/IWCSService.cs" new file mode 100644 index 0000000..3857f3b --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStoragIntegrationServices/WCS/IWCSService.cs" @@ -0,0 +1,14 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Core; + +namespace WIDESEA_IStoragIntegrationServices +{ + public interface IWCSService : IDependency + { + + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStoragIntegrationServices/ZY/IToZYService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStoragIntegrationServices/ZY/IToZYService.cs" new file mode 100644 index 0000000..d8a0b3c --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStoragIntegrationServices/ZY/IToZYService.cs" @@ -0,0 +1,23 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Common; +using WIDESEA_Core; +using WIDESEA_Model.Models; + +namespace WIDESEA_IStoragIntegrationServices +{ + public interface IToZYService : IDependency + { + WebResponseContent ZY_GetCLInfo(SaveModel saveModel); + + + WebResponseContent getZDPInfo(SaveModel saveModel); + + WebResponseContent getCZInfo(SaveModel saveModel); + + WebResponseContent ReportToSCE(Dt_CheckResult checkResult); + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStoragIntegrationServices/\346\226\260\346\226\207\344\273\266\345\244\271/IToCheckService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStoragIntegrationServices/\346\226\260\346\226\207\344\273\266\345\244\271/IToCheckService.cs" new file mode 100644 index 0000000..a6b3c04 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStoragIntegrationServices/\346\226\260\346\226\207\344\273\266\345\244\271/IToCheckService.cs" @@ -0,0 +1,15 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Common; +using WIDESEA_Core; + +namespace WIDESEA_IStoragIntegrationServices +{ + public interface IToAGVService : IDependency + { + + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicRepository/BasicInfo/IDt_SelectionStandardsRepository.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicRepository/BasicInfo/IDt_SelectionStandardsRepository.cs" new file mode 100644 index 0000000..e630c09 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicRepository/BasicInfo/IDt_SelectionStandardsRepository.cs" @@ -0,0 +1,32 @@ +锘�#region << 鐗� 鏈� 娉� 閲� >> +/*---------------------------------------------------------------- + * 鍛藉悕绌洪棿锛歐IDESEAWCS_ITaskInfoRepository + * 鍒涘缓鑰咃細鑳$搴� + * 鍒涘缓鏃堕棿锛�2024/8/2 16:13:36 + * 鐗堟湰锛歏1.0.0 + * 鎻忚堪锛� + * + * ---------------------------------------------------------------- + * 淇敼浜猴細 + * 淇敼鏃堕棿锛� + * 鐗堟湰锛歏1.0.1 + * 淇敼璇存槑锛� + * + *----------------------------------------------------------------*/ +#endregion << 鐗� 鏈� 娉� 閲� >> + + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEAWCS_Model.Models; + +namespace WIDESEAWCS_BasicInfoRepository +{ + public interface IDt_SelectionStandardsRepository : IRepository<Dt_SelectionStandards> + { + + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicRepository/BasicInfo/IDt_StationManagerRepository.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicRepository/BasicInfo/IDt_StationManagerRepository.cs" new file mode 100644 index 0000000..b6a59ef --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicRepository/BasicInfo/IDt_StationManagerRepository.cs" @@ -0,0 +1,31 @@ +锘�#region << 鐗� 鏈� 娉� 閲� >> +/*---------------------------------------------------------------- + * 鍛藉悕绌洪棿锛歐IDESEAWCS_ITaskInfoRepository + * 鍒涘缓鑰咃細鑳$搴� + * 鍒涘缓鏃堕棿锛�2024/8/2 16:13:36 + * 鐗堟湰锛歏1.0.0 + * 鎻忚堪锛� + * + * ---------------------------------------------------------------- + * 淇敼浜猴細 + * 淇敼鏃堕棿锛� + * 鐗堟湰锛歏1.0.1 + * 淇敼璇存槑锛� + * + *----------------------------------------------------------------*/ +#endregion << 鐗� 鏈� 娉� 閲� >> + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEAWCS_Model.Models; + +namespace WIDESEAWCS_BasicInfoRepository +{ + public interface IDt_StationManagerRepository : IRepository<Dt_StationManager> + { + + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicRepository/BasicInfo/IDt_TraintypeRepository.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicRepository/BasicInfo/IDt_TraintypeRepository.cs" new file mode 100644 index 0000000..b96ea52 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicRepository/BasicInfo/IDt_TraintypeRepository.cs" @@ -0,0 +1,32 @@ +锘�#region << 鐗� 鏈� 娉� 閲� >> +/*---------------------------------------------------------------- + * 鍛藉悕绌洪棿锛歐IDESEAWCS_ITaskInfoRepository + * 鍒涘缓鑰咃細鑳$搴� + * 鍒涘缓鏃堕棿锛�2024/8/2 16:13:36 + * 鐗堟湰锛歏1.0.0 + * 鎻忚堪锛� + * + * ---------------------------------------------------------------- + * 淇敼浜猴細 + * 淇敼鏃堕棿锛� + * 鐗堟湰锛歏1.0.1 + * 淇敼璇存槑锛� + * + *----------------------------------------------------------------*/ +#endregion << 鐗� 鏈� 娉� 閲� >> + + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEAWCS_Model.Models; + +namespace WIDESEAWCS_BasicInfoRepository +{ + public interface IDt_TraintypeRepository : IRepository<Dt_Traintype> + { + + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicRepository/BasicInfo/IDt_needBarcodeRepository.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicRepository/BasicInfo/IDt_needBarcodeRepository.cs" new file mode 100644 index 0000000..f703426 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicRepository/BasicInfo/IDt_needBarcodeRepository.cs" @@ -0,0 +1,32 @@ +锘�#region << 鐗� 鏈� 娉� 閲� >> +/*---------------------------------------------------------------- + * 鍛藉悕绌洪棿锛歐IDESEAWCS_ITaskInfoRepository + * 鍒涘缓鑰咃細鑳$搴� + * 鍒涘缓鏃堕棿锛�2024/8/2 16:13:36 + * 鐗堟湰锛歏1.0.0 + * 鎻忚堪锛� + * + * ---------------------------------------------------------------- + * 淇敼浜猴細 + * 淇敼鏃堕棿锛� + * 鐗堟湰锛歏1.0.1 + * 淇敼璇存槑锛� + * + *----------------------------------------------------------------*/ +#endregion << 鐗� 鏈� 娉� 閲� >> + + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEAWCS_Model.Models; + +namespace WIDESEAWCS_BasicInfoRepository +{ + public interface IDt_needBarcodeRepository : IRepository<dt_needBarcode> + { + + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicRepository/Boxing/IBoxingInfoDetailRepository.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicRepository/Boxing/IBoxingInfoDetailRepository.cs" new file mode 100644 index 0000000..6ab4efc --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicRepository/Boxing/IBoxingInfoDetailRepository.cs" @@ -0,0 +1,6 @@ +锘縩amespace WIDESEA_IStorageBasicRepository +{ + public interface IBoxingInfoDetailRepository : IRepository<DtBoxingInfoDetail> + { + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicRepository/Boxing/IBoxingInfoRepository.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicRepository/Boxing/IBoxingInfoRepository.cs" new file mode 100644 index 0000000..bdef9a1 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicRepository/Boxing/IBoxingInfoRepository.cs" @@ -0,0 +1,6 @@ +锘縩amespace WIDESEA_IStorageBasicRepository +{ + public interface IBoxingInfoRepository : IRepository<DtBoxingInfo> + { + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicRepository/Boxing/IDt_CZInfo_mesRepository.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicRepository/Boxing/IDt_CZInfo_mesRepository.cs" new file mode 100644 index 0000000..4e52f12 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicRepository/Boxing/IDt_CZInfo_mesRepository.cs" @@ -0,0 +1,8 @@ +锘縰sing WIDESEA_Model.Models; + +namespace WIDESEA_IStorageBasicRepository +{ + public interface IDt_CZInfo_mesRepository : IRepository<Dt_CZInfo_mes> + { + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicRepository/Boxing/IDt_CZInfo_mes_htyRepository.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicRepository/Boxing/IDt_CZInfo_mes_htyRepository.cs" new file mode 100644 index 0000000..7c5e9db --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicRepository/Boxing/IDt_CZInfo_mes_htyRepository.cs" @@ -0,0 +1,8 @@ +锘縰sing WIDESEA_Model.Models; + +namespace WIDESEA_IStorageBasicRepository +{ + public interface IDt_CZInfo_mes_htyRepository : IRepository<Dt_CZInfo_mes_hty> + { + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicRepository/Boxing/IDt_InWheels_mesRepository.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicRepository/Boxing/IDt_InWheels_mesRepository.cs" new file mode 100644 index 0000000..3c67712 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicRepository/Boxing/IDt_InWheels_mesRepository.cs" @@ -0,0 +1,8 @@ +锘縰sing WIDESEA_Model.Models; + +namespace WIDESEA_IStorageBasicRepository +{ + public interface IDt_InWheels_mesRepository : IRepository<Dt_InWheels_mes> + { + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicRepository/Boxing/IDt_InWheels_mes_htyRepository.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicRepository/Boxing/IDt_InWheels_mes_htyRepository.cs" new file mode 100644 index 0000000..b75a3bf --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicRepository/Boxing/IDt_InWheels_mes_htyRepository.cs" @@ -0,0 +1,8 @@ +锘縰sing WIDESEA_Model.Models; + +namespace WIDESEA_IStorageBasicRepository +{ + public interface IDt_InWheels_mes_htyRepository : IRepository<Dt_InWheels_mes_hty> + { + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicRepository/CacheInfo/IDt_CacheInfoRepository.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicRepository/CacheInfo/IDt_CacheInfoRepository.cs" new file mode 100644 index 0000000..b3488fe --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicRepository/CacheInfo/IDt_CacheInfoRepository.cs" @@ -0,0 +1,6 @@ +锘縩amespace WIDESEA_IStorageBasicRepository +{ + public interface IDt_CacheInfoRepository : IRepository<Dt_CacheInfo> + { + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicRepository/Check/IDt_CacheInfo_htyRepository.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicRepository/Check/IDt_CacheInfo_htyRepository.cs" new file mode 100644 index 0000000..f45f49c --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicRepository/Check/IDt_CacheInfo_htyRepository.cs" @@ -0,0 +1,6 @@ +锘縩amespace WIDESEA_IStorageBasicRepository +{ + public interface IDt_CacheInfo_htyRepository : IRepository<Dt_CacheInfo_hty> + { + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicRepository/Check/IDt_CheckResultRepository.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicRepository/Check/IDt_CheckResultRepository.cs" new file mode 100644 index 0000000..18c0ae6 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicRepository/Check/IDt_CheckResultRepository.cs" @@ -0,0 +1,6 @@ +锘縩amespace WIDESEA_IStorageBasicRepository +{ + public interface IDt_CheckResultRepository : IRepository<Dt_CheckResult> + { + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicRepository/GlobalUsing.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicRepository/GlobalUsing.cs" new file mode 100644 index 0000000..db797a1 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicRepository/GlobalUsing.cs" @@ -0,0 +1,2 @@ +锘縢lobal using WIDESEA_Core.BaseRepository; +global using WIDESEA_Model.Models; diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicRepository/Location/ILocationInfoRepository.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicRepository/Location/ILocationInfoRepository.cs" new file mode 100644 index 0000000..1270d09 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicRepository/Location/ILocationInfoRepository.cs" @@ -0,0 +1,5 @@ +锘縩amespace WIDESEA_IStorageBasicRepository; + +public interface ILocationInfoRepository : IRepository<DtLocationInfo> +{ +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicRepository/Location/ILocationStatusChangeRecordRepository.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicRepository/Location/ILocationStatusChangeRecordRepository.cs" new file mode 100644 index 0000000..9755f1d --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicRepository/Location/ILocationStatusChangeRecordRepository.cs" @@ -0,0 +1,17 @@ +锘縰sing WIDESEA_DTO; + +namespace WIDESEA_IStorageBasicRepository; + +public interface ILocationStatusChangeRecordRepository : IRepository<DtLocationStatusChangeRecord> +{ + /// <summary> + /// 娣诲姞璐т綅鍙樺姩璁板綍 + /// </summary> + /// <param name="changeRecordDto">鏁版嵁妯″瀷</param> + /// <returns></returns> + bool AddStatusChangeRecord(LocationChangeRecordDto changeRecordDto); + + void AddLocationStatusChangeRecord(DtLocationInfo locationInfo, int lastStatus, int changeType, int? taskNum); + + void AddLocationStatusChangeRecord(List<DtLocationInfo> locationInfos, int newStatus, int changeType, List<int>? taskNums); +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicRepository/Stock/IDt_WheelsStockRepository.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicRepository/Stock/IDt_WheelsStockRepository.cs" new file mode 100644 index 0000000..9b678ae --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicRepository/Stock/IDt_WheelsStockRepository.cs" @@ -0,0 +1,6 @@ +锘縩amespace WIDESEA_IStorageBasicRepository +{ + public interface IDt_WheelsStockRepository : IRepository<Dt_WheelsStock> + { + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicRepository/Stock/IDt_WheelsStock_OldRepository.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicRepository/Stock/IDt_WheelsStock_OldRepository.cs" new file mode 100644 index 0000000..ee87a7b --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicRepository/Stock/IDt_WheelsStock_OldRepository.cs" @@ -0,0 +1,6 @@ +锘縩amespace WIDESEA_IStorageBasicRepository +{ + public interface IDt_WheelsStock_OldRepository : IRepository<Dt_WheelsStock_Old> + { + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicRepository/Stock/IDt_WheelsStock_htyRepository.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicRepository/Stock/IDt_WheelsStock_htyRepository.cs" new file mode 100644 index 0000000..570067d --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicRepository/Stock/IDt_WheelsStock_htyRepository.cs" @@ -0,0 +1,6 @@ +锘縩amespace WIDESEA_IStorageBasicRepository +{ + public interface IDt_WheelsStock_htyRepository : IRepository<Dt_WheelsStock_hty> + { + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicRepository/Stock/IStockInfoDetailRepository.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicRepository/Stock/IStockInfoDetailRepository.cs" new file mode 100644 index 0000000..d5b0faa --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicRepository/Stock/IStockInfoDetailRepository.cs" @@ -0,0 +1,14 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Core.BaseRepository; +using WIDESEA_Model.Models; + +namespace WIDESEA_IStorageBasicRepository +{ + public interface IStockInfoDetailRepository : IRepository<DtStockInfoDetail> + { + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicRepository/Stock/IStockInfoRepository.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicRepository/Stock/IStockInfoRepository.cs" new file mode 100644 index 0000000..23c73b4 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicRepository/Stock/IStockInfoRepository.cs" @@ -0,0 +1,6 @@ +锘縩amespace WIDESEA_IStorageBasicRepository +{ + public interface IStockInfoRepository : IRepository<DtStockInfo> + { + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicService/BasicInfo/IDt_SelectionStandardsService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicService/BasicInfo/IDt_SelectionStandardsService.cs" new file mode 100644 index 0000000..c2cc81b --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicService/BasicInfo/IDt_SelectionStandardsService.cs" @@ -0,0 +1,27 @@ +锘�#region << 鐗� 鏈� 娉� 閲� >> + +/*---------------------------------------------------------------- + * 鍛藉悕绌洪棿锛歐IDESEAWCS_ITaskInfoService + * 鍒涘缓鑰咃細鑳$搴� + * 鍒涘缓鏃堕棿锛�2024/8/2 16:13:36 + * 鐗堟湰锛歏1.0.0 + * 鎻忚堪锛� + * + * ---------------------------------------------------------------- + * 淇敼浜猴細 + * 淇敼鏃堕棿锛� + * 鐗堟湰锛歏1.0.1 + * 淇敼璇存槑锛� + * + *----------------------------------------------------------------*/ + +#endregion << 鐗� 鏈� 娉� 閲� >> + +using WIDESEAWCS_Model.Models; + +namespace WIDESEAWCS_BasicInfoService +{ + public interface IDt_SelectionStandardsService : IService<Dt_SelectionStandards> + { + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicService/BasicInfo/IDt_StationManagerService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicService/BasicInfo/IDt_StationManagerService.cs" new file mode 100644 index 0000000..ce3a1b1 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicService/BasicInfo/IDt_StationManagerService.cs" @@ -0,0 +1,30 @@ +锘�#region << 鐗� 鏈� 娉� 閲� >> + +/*---------------------------------------------------------------- + * 鍛藉悕绌洪棿锛歐IDESEAWCS_ITaskInfoService + * 鍒涘缓鑰咃細鑳$搴� + * 鍒涘缓鏃堕棿锛�2024/8/2 16:13:36 + * 鐗堟湰锛歏1.0.0 + * 鎻忚堪锛� + * + * ---------------------------------------------------------------- + * 淇敼浜猴細 + * 淇敼鏃堕棿锛� + * 鐗堟湰锛歏1.0.1 + * 淇敼璇存槑锛� + * + *----------------------------------------------------------------*/ + +#endregion << 鐗� 鏈� 娉� 閲� >> + +using WIDESEAWCS_Model.Models; + +namespace WIDESEAWCS_BasicInfoService +{ + public interface IDt_StationManagerService : IService<Dt_StationManager> + { + List<Dt_StationManager> GetAllStationByDeviceCode(string DeviceCode); + + Dt_StationManager GetStationInfoByChildCode(string ChildCode); + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicService/BasicInfo/IDt_TraintypeService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicService/BasicInfo/IDt_TraintypeService.cs" new file mode 100644 index 0000000..6d4ba4d --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicService/BasicInfo/IDt_TraintypeService.cs" @@ -0,0 +1,27 @@ +锘�#region << 鐗� 鏈� 娉� 閲� >> + +/*---------------------------------------------------------------- + * 鍛藉悕绌洪棿锛歐IDESEAWCS_ITaskInfoService + * 鍒涘缓鑰咃細鑳$搴� + * 鍒涘缓鏃堕棿锛�2024/8/2 16:13:36 + * 鐗堟湰锛歏1.0.0 + * 鎻忚堪锛� + * + * ---------------------------------------------------------------- + * 淇敼浜猴細 + * 淇敼鏃堕棿锛� + * 鐗堟湰锛歏1.0.1 + * 淇敼璇存槑锛� + * + *----------------------------------------------------------------*/ + +#endregion << 鐗� 鏈� 娉� 閲� >> + +using WIDESEAWCS_Model.Models; + +namespace WIDESEAWCS_BasicInfoService +{ + public interface IDt_TraintypeService : IService<Dt_Traintype> + { + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicService/BasicInfo/IDt_needBarcodeService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicService/BasicInfo/IDt_needBarcodeService.cs" new file mode 100644 index 0000000..dafcc4a --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicService/BasicInfo/IDt_needBarcodeService.cs" @@ -0,0 +1,28 @@ +锘�#region << 鐗� 鏈� 娉� 閲� >> + +/*---------------------------------------------------------------- + * 鍛藉悕绌洪棿锛歐IDESEAWCS_ITaskInfoService + * 鍒涘缓鑰咃細鑳$搴� + * 鍒涘缓鏃堕棿锛�2024/8/2 16:13:36 + * 鐗堟湰锛歏1.0.0 + * 鎻忚堪锛� + * + * ---------------------------------------------------------------- + * 淇敼浜猴細 + * 淇敼鏃堕棿锛� + * 鐗堟湰锛歏1.0.1 + * 淇敼璇存槑锛� + * + *----------------------------------------------------------------*/ + +#endregion << 鐗� 鏈� 娉� 閲� >> + +using WIDESEAWCS_Model.Models; + +namespace WIDESEAWCS_BasicInfoService +{ + public interface Idt_needBarcodeService : IService<dt_needBarcode> + { + + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicService/Boxing/IBoxingInfoDetailService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicService/Boxing/IBoxingInfoDetailService.cs" new file mode 100644 index 0000000..e343681 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicService/Boxing/IBoxingInfoDetailService.cs" @@ -0,0 +1,5 @@ +锘縩amespace WIDESEA_IStorageBasicService; + +public interface IBoxingInfoDetailService : IService<DtBoxingInfoDetail> +{ +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicService/Boxing/IBoxingInfoService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicService/Boxing/IBoxingInfoService.cs" new file mode 100644 index 0000000..ffc35de --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicService/Boxing/IBoxingInfoService.cs" @@ -0,0 +1,13 @@ +锘縰sing Microsoft.AspNetCore.Mvc; + +namespace WIDESEA_IStorageBasicService; + +public interface IBoxingInfoService : IService<DtBoxingInfo> +{ + /// <summary> + /// 娣诲姞缁勭洏 + /// </summary> + /// <param name="boxingInfo"></param> + /// <returns></returns> + Task<WebResponseContent> AddBoxingInfoAsync( DtBoxingInfo boxingInfo); +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicService/Boxing/IDt_CZInfo_mesService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicService/Boxing/IDt_CZInfo_mesService.cs" new file mode 100644 index 0000000..72d4dff --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicService/Boxing/IDt_CZInfo_mesService.cs" @@ -0,0 +1,8 @@ +锘縰sing Microsoft.AspNetCore.Mvc; + +namespace WIDESEA_IStorageBasicService; + +public interface IDt_CZInfo_mesService : IService<Dt_CZInfo_mes> +{ + +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicService/Boxing/IDt_CZInfo_mes_htyService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicService/Boxing/IDt_CZInfo_mes_htyService.cs" new file mode 100644 index 0000000..5b6905a --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicService/Boxing/IDt_CZInfo_mes_htyService.cs" @@ -0,0 +1,8 @@ +锘縰sing Microsoft.AspNetCore.Mvc; + +namespace WIDESEA_IStorageBasicService; + +public interface IDt_CZInfo_mes_htyService : IService<Dt_CZInfo_mes_hty> +{ + +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicService/Boxing/IDt_InWheels_mesService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicService/Boxing/IDt_InWheels_mesService.cs" new file mode 100644 index 0000000..1da13e5 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicService/Boxing/IDt_InWheels_mesService.cs" @@ -0,0 +1,8 @@ +锘縰sing Microsoft.AspNetCore.Mvc; + +namespace WIDESEA_IStorageBasicService; + +public interface IDt_InWheels_mesService : IService<Dt_InWheels_mes> +{ + +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicService/Boxing/IDt_InWheels_mes_htyService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicService/Boxing/IDt_InWheels_mes_htyService.cs" new file mode 100644 index 0000000..5b6ba91 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicService/Boxing/IDt_InWheels_mes_htyService.cs" @@ -0,0 +1,8 @@ +锘縰sing Microsoft.AspNetCore.Mvc; + +namespace WIDESEA_IStorageBasicService; + +public interface IDt_InWheels_mes_htyService : IService<Dt_InWheels_mes_hty> +{ + +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicService/CacheInfo/IDt_CacheInfoService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicService/CacheInfo/IDt_CacheInfoService.cs" new file mode 100644 index 0000000..2925aa9 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicService/CacheInfo/IDt_CacheInfoService.cs" @@ -0,0 +1,13 @@ +锘縰sing Microsoft.AspNetCore.Mvc; + +namespace WIDESEA_IStorageBasicService; + +public interface IDt_CacheInfoService : IService<Dt_CacheInfo> +{ + /// <summary> + /// + /// </summary> + /// <param name="cacheInfo"></param> + /// <returns></returns> + WebResponseContent AddCacheInfoByAPP(SaveModel input); +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicService/CacheInfo/IDt_CacheInfo_htyService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicService/CacheInfo/IDt_CacheInfo_htyService.cs" new file mode 100644 index 0000000..cfb0297 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicService/CacheInfo/IDt_CacheInfo_htyService.cs" @@ -0,0 +1,8 @@ +锘縰sing Microsoft.AspNetCore.Mvc; + +namespace WIDESEA_IStorageBasicService; + +public interface IDt_CacheInfo_htyService : IService<Dt_CacheInfo_hty> +{ + +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicService/Check/IDt_CheckResultService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicService/Check/IDt_CheckResultService.cs" new file mode 100644 index 0000000..c43d908 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicService/Check/IDt_CheckResultService.cs" @@ -0,0 +1,6 @@ +锘縩amespace WIDESEA_IStorageBasicService; + +public interface IDt_CheckResultService : IService<Dt_CheckResult> +{ + WebResponseContent HandUploadData(int id); +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicService/GlobalUsing.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicService/GlobalUsing.cs" new file mode 100644 index 0000000..6dfb8c0 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicService/GlobalUsing.cs" @@ -0,0 +1,3 @@ +锘縢lobal using WIDESEA_Core; +global using WIDESEA_Core.BaseServices; +global using WIDESEA_Model.Models; diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicService/Location/ILocationInfoService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicService/Location/ILocationInfoService.cs" new file mode 100644 index 0000000..6424160 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicService/Location/ILocationInfoService.cs" @@ -0,0 +1,19 @@ +锘縰sing WIDESEA_DTO; + +namespace WIDESEA_IStorageBasicService; + +public interface ILocationInfoService : IService<DtLocationInfo> +{ + /// <summary> + /// 妫�鏌ュ苟鐢熸垚绉诲簱浠诲姟鎴栬繑鍥炲嚭搴撲换鍔� + /// </summary> + /// <param name="locationID">浠诲姟鍙�</param> + /// <returns>浠诲姟瀵硅薄</returns> + Task<Dt_Task> TransferCheckAsync(RequestTaskDto input); + + Task<WebResponseContent> initializeLocation(int locationID); + + WebResponseContent CreateLocation(int x, int y, int z, int locType, int areaId); + + WebResponseContent LocationEnable(SaveModel saveModel); +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicService/Location/ILocationStatusChangeRecordService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicService/Location/ILocationStatusChangeRecordService.cs" new file mode 100644 index 0000000..cf9fc08 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicService/Location/ILocationStatusChangeRecordService.cs" @@ -0,0 +1,5 @@ +锘縩amespace WIDESEA_IStorageBasicService; + +public interface ILocationStatusChangeRecordService : IService<DtLocationStatusChangeRecord> +{ +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicService/Stock/IDt_WheelsStockService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicService/Stock/IDt_WheelsStockService.cs" new file mode 100644 index 0000000..470944c --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicService/Stock/IDt_WheelsStockService.cs" @@ -0,0 +1,7 @@ +锘縩amespace WIDESEA_IStorageBasicService; + +public interface IDt_WheelsStockService : IService<Dt_WheelsStock> +{ + + Dt_WheelsStock GetSelectionWheelsStock(List<Dt_WheelsStock> wheelsStocks, Dt_SelectionStandards selectionStandards, Dt_CZInfo_mes CZInfo_Mes,string wheelsPosition,string newOrOld); +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicService/Stock/IDt_WheelsStock_OldService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicService/Stock/IDt_WheelsStock_OldService.cs" new file mode 100644 index 0000000..d164791 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicService/Stock/IDt_WheelsStock_OldService.cs" @@ -0,0 +1,7 @@ +锘縩amespace WIDESEA_IStorageBasicService; + +public interface IDt_WheelsStock_OldService : IService<Dt_WheelsStock_Old> +{ + + WebResponseContent GetOldLocationWheels(); +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicService/Stock/IDt_WheelsStock_htyService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicService/Stock/IDt_WheelsStock_htyService.cs" new file mode 100644 index 0000000..cb1ea93 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicService/Stock/IDt_WheelsStock_htyService.cs" @@ -0,0 +1,6 @@ +锘縩amespace WIDESEA_IStorageBasicService; + +public interface IDt_WheelsStock_htyService : IService<Dt_WheelsStock_hty> +{ + +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicService/Stock/IStockInfoDetailService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicService/Stock/IStockInfoDetailService.cs" new file mode 100644 index 0000000..cfba088 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicService/Stock/IStockInfoDetailService.cs" @@ -0,0 +1,5 @@ +锘縩amespace WIDESEA_IStorageBasicService; + +public interface IStockInfoDetailService : IService<DtStockInfoDetail> +{ +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicService/Stock/IStockInfoService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicService/Stock/IStockInfoService.cs" new file mode 100644 index 0000000..9f1ddfa --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicService/Stock/IStockInfoService.cs" @@ -0,0 +1,5 @@ +锘縩amespace WIDESEA_IStorageBasicService; + +public interface IStockInfoService : IService<DtStockInfo> +{ +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageOutOrderRepository/GlobalUsing.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageOutOrderRepository/GlobalUsing.cs" new file mode 100644 index 0000000..db797a1 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageOutOrderRepository/GlobalUsing.cs" @@ -0,0 +1,2 @@ +锘縢lobal using WIDESEA_Core.BaseRepository; +global using WIDESEA_Model.Models; diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageOutOrderRepository/OutboundOrder/IDt_OutOrderAndStockRepository.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageOutOrderRepository/OutboundOrder/IDt_OutOrderAndStockRepository.cs" new file mode 100644 index 0000000..f1a834e --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageOutOrderRepository/OutboundOrder/IDt_OutOrderAndStockRepository.cs" @@ -0,0 +1,27 @@ +锘縩amespace WIDESEA_IStorageOutOrderRepository; + +public interface IDt_OutOrderAndStockRepository : IRepository<Dt_OutOrderAndStock> +{ + /// <summary> + /// 鏍规嵁鐗瑰畾鏉′欢鑾峰彇鍑哄簱鐗╂枡淇℃伅 + /// </summary> + /// <param name="locationID">璐т綅ID</param> + /// <param name="orderNum">鍑哄簱璁㈠崟</param> + /// <param name="palletCode">鎵樼洏鍙�</param> + /// <returns>鍑哄簱鐗╂枡淇℃伅</returns> + Task<Dt_OutOrderAndStock> GetOrderAndStock(string locationID = null, string orderNum = null, string palletCode = null); + + /// <summary> + /// 瀵艰埅鍒犻櫎 + /// </summary> + /// <param name="stock">鍑哄簱鐗╂枡淇℃伅</param> + /// <returns>鎴愬姛/澶辫触</returns> + bool DeleteNavOrderStock(Dt_OutOrderAndStock stock); + + /// <summary> + /// 瀵艰埅鏇存柊 + /// </summary> + /// <param name="stock">鍑哄簱鐗╂枡淇℃伅</param> + /// <returns>鎴愬姛/澶辫触</returns> + bool UpdateNavOrderStock(Dt_OutOrderAndStock stock); +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageOutOrderRepository/OutboundOrder/IDt_OutOrderAndStock_HtyRepository.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageOutOrderRepository/OutboundOrder/IDt_OutOrderAndStock_HtyRepository.cs" new file mode 100644 index 0000000..3a9aea6 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageOutOrderRepository/OutboundOrder/IDt_OutOrderAndStock_HtyRepository.cs" @@ -0,0 +1,11 @@ +锘縩amespace WIDESEA_IStorageOutOrderRepository; + +public interface IDt_OutOrderAndStock_HtyRepository : IRepository<Dt_OutOrderAndStock_Hty> +{ + /// <summary> + /// 瀵艰埅娣诲姞锛堟坊鍔犲簱瀛樹富浠庡巻鍙诧紝璁㈠崟涓讳粠鍘嗗彶锛� + /// </summary> + /// <param name="stock">鍑哄簱鐗╂枡淇℃伅鍘嗗彶</param> + /// <returns>鎴愬姛/澶辫触</returns> + bool InsertNav(Dt_OutOrderAndStock_Hty stock); +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageOutOrderRepository/OutboundOrder/IDt_OutOrderDtailRepository.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageOutOrderRepository/OutboundOrder/IDt_OutOrderDtailRepository.cs" new file mode 100644 index 0000000..3ee62e2 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageOutOrderRepository/OutboundOrder/IDt_OutOrderDtailRepository.cs" @@ -0,0 +1,5 @@ +锘縩amespace WIDESEA_IStorageOutOrderRepository; + +public interface IDt_OutOrderDtailRepository : IRepository<Dt_OutOrderDetail> +{ +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageOutOrderRepository/OutboundOrder/IDt_OutOrderProductionDetailRepository.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageOutOrderRepository/OutboundOrder/IDt_OutOrderProductionDetailRepository.cs" new file mode 100644 index 0000000..2625074 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageOutOrderRepository/OutboundOrder/IDt_OutOrderProductionDetailRepository.cs" @@ -0,0 +1,5 @@ +锘縩amespace WIDESEA_IStorageOutOrderRepository; + +public interface IDt_OutOrderProductionDetailRepository : IRepository<Dt_OutOrderProductionDetail> +{ +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageOutOrderRepository/OutboundOrder/IDt_OutOrderProductionRepository.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageOutOrderRepository/OutboundOrder/IDt_OutOrderProductionRepository.cs" new file mode 100644 index 0000000..921971c --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageOutOrderRepository/OutboundOrder/IDt_OutOrderProductionRepository.cs" @@ -0,0 +1,11 @@ +锘縩amespace WIDESEA_IStorageOutOrderRepository; + +public interface IDt_OutOrderProductionRepository : IRepository<Dt_OutOrderProduction> +{ + /// <summary> + /// 鎻掑叆鏁版嵁杩斿洖涓婚敭 + /// </summary> + /// <param name="production">瀹炰綋鏁版嵁</param> + /// <returns>涓婚敭ID</returns> + int InsertOrderProduction(Dt_OutOrderProduction production); +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageOutOrderRepository/OutboundOrder/IDt_OutOrderRepository.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageOutOrderRepository/OutboundOrder/IDt_OutOrderRepository.cs" new file mode 100644 index 0000000..c8e9900 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageOutOrderRepository/OutboundOrder/IDt_OutOrderRepository.cs" @@ -0,0 +1,15 @@ +锘縰sing WIDESEA_Core; + +namespace WIDESEA_IStorageOutOrderRepository; + +public interface IDt_OutOrderRepository : IRepository<Dt_OutOrder> +{ + /// <summary> + /// 淇敼鍑哄簱璁㈠崟锛堝鑸慨鏀癸級 + /// </summary> + /// <param name="outOrder"></param> + /// <returns>鏄惁鎴愬姛</returns> + Task<bool> OutOrderUpdatedAsync(Dt_OutOrder outOrder); + + Task<Dt_OutOrder> GetOutOrderByNumberAsync(string orderNumber); +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageOutOrderRepository/OutboundOrder/IDt_OutOrderTransferDetailRepository.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageOutOrderRepository/OutboundOrder/IDt_OutOrderTransferDetailRepository.cs" new file mode 100644 index 0000000..e5e7ded --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageOutOrderRepository/OutboundOrder/IDt_OutOrderTransferDetailRepository.cs" @@ -0,0 +1,5 @@ +锘縩amespace WIDESEA_IStorageOutOrderRepository; + +public interface IDt_OutOrderTransferDetailRepository : IRepository<Dt_OutOrderTransferDetail> +{ +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageOutOrderRepository/OutboundOrder/IDt_OutOrderTransferRepository.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageOutOrderRepository/OutboundOrder/IDt_OutOrderTransferRepository.cs" new file mode 100644 index 0000000..0bddca4 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageOutOrderRepository/OutboundOrder/IDt_OutOrderTransferRepository.cs" @@ -0,0 +1,5 @@ +锘縩amespace WIDESEA_IStorageOutOrderRepository; + +public interface IDt_OutOrderTransferRepository : IRepository<Dt_OutOrderTransfer> +{ +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageOutOrderService/GlobalUsing.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageOutOrderService/GlobalUsing.cs" new file mode 100644 index 0000000..d9777d7 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageOutOrderService/GlobalUsing.cs" @@ -0,0 +1,3 @@ +锘縢lobal using WIDESEA_Core; +global using WIDESEA_Core.BaseServices; +global using WIDESEA_Model.Models; \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageOutOrderService/OutboundOrder/IDt_OutOrderAndStockService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageOutOrderService/OutboundOrder/IDt_OutOrderAndStockService.cs" new file mode 100644 index 0000000..0252119 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageOutOrderService/OutboundOrder/IDt_OutOrderAndStockService.cs" @@ -0,0 +1,27 @@ +锘縩amespace WIDESEA_IStorageOutOrderServices; + +public interface IDt_OutOrderAndStockService : IService<Dt_OutOrderAndStock> +{ + /// <summary> + /// 鏍规嵁鐗瑰畾鏉′欢鑾峰彇鍑哄簱鐗╂枡淇℃伅 + /// </summary> + /// <param name="locationID">璐т綅ID</param> + /// <param name="orderNum">鍑哄簱璁㈠崟</param> + /// <param name="palletCode">鎵樼洏鍙�</param> + /// <returns>鍑哄簱鐗╂枡淇℃伅</returns> + Task<Dt_OutOrderAndStock> GetOrderAndStock(string locationID = null, string orderNum = null, string palletCode = null); + + /// <summary> + /// 瀵艰埅鍒犻櫎 + /// </summary> + /// <param name="stock">鍑哄簱鐗╂枡淇℃伅</param> + /// <returns>鎴愬姛/澶辫触</returns> + bool DeleteNavOrderStock(Dt_OutOrderAndStock stock); + + /// <summary> + /// 瀵艰埅鏇存柊 + /// </summary> + /// <param name="stock">鍑哄簱鐗╂枡淇℃伅</param> + /// <returns>鎴愬姛/澶辫触</returns> + bool UpdateNavOrderStock(Dt_OutOrderAndStock stock); +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageOutOrderService/OutboundOrder/IDt_OutOrderAndStock_HtyService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageOutOrderService/OutboundOrder/IDt_OutOrderAndStock_HtyService.cs" new file mode 100644 index 0000000..4f353df --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageOutOrderService/OutboundOrder/IDt_OutOrderAndStock_HtyService.cs" @@ -0,0 +1,11 @@ +锘縩amespace WIDESEA_IStorageOutOrderServices; + +public interface IDt_OutOrderAndStock_HtyService : IService<Dt_OutOrderAndStock_Hty> +{ + /// <summary> + /// 瀵艰埅娣诲姞锛堟坊鍔犲簱瀛樹富浠庡巻鍙诧紝璁㈠崟涓讳粠鍘嗗彶锛� + /// </summary> + /// <param name="stock">鍑哄簱鐗╂枡淇℃伅鍘嗗彶</param> + /// <returns>鎴愬姛/澶辫触</returns> + bool InsertNav(Dt_OutOrderAndStock_Hty stock); +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageOutOrderService/OutboundOrder/IDt_OutOrderDtailService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageOutOrderService/OutboundOrder/IDt_OutOrderDtailService.cs" new file mode 100644 index 0000000..3b41b6e --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageOutOrderService/OutboundOrder/IDt_OutOrderDtailService.cs" @@ -0,0 +1,5 @@ +锘縩amespace WIDESEA_IStorageOutOrderServices; + +public interface IDt_OutOrderDtailService : IService<Dt_OutOrderDetail> +{ +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageOutOrderService/OutboundOrder/IDt_OutOrderProductionDetailService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageOutOrderService/OutboundOrder/IDt_OutOrderProductionDetailService.cs" new file mode 100644 index 0000000..f1bcb6f --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageOutOrderService/OutboundOrder/IDt_OutOrderProductionDetailService.cs" @@ -0,0 +1,11 @@ +锘縩amespace WIDESEA_IStorageOutOrderServices; + +public interface IDt_OutOrderProductionDetailService : IService<Dt_OutOrderProductionDetail> +{ + /// <summary> + /// 鎻掑叆鏁版嵁杩斿洖涓婚敭 + /// </summary> + /// <param name="productionDetail">瀹炰綋鏁版嵁</param> + /// <returns>涓婚敭ID</returns> + int AddOrderProductionDetail(Dt_OutOrderProductionDetail productionDetail); +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageOutOrderService/OutboundOrder/IDt_OutOrderProductionService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageOutOrderService/OutboundOrder/IDt_OutOrderProductionService.cs" new file mode 100644 index 0000000..33dc77d --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageOutOrderService/OutboundOrder/IDt_OutOrderProductionService.cs" @@ -0,0 +1,11 @@ +锘縩amespace WIDESEA_IStorageOutOrderServices; + +public interface IDt_OutOrderProductionService : IService<Dt_OutOrderProduction> +{ + /// <summary> + /// 鎻掑叆鏁版嵁杩斿洖涓婚敭 + /// </summary> + /// <param name="production">瀹炰綋鏁版嵁</param> + /// <returns>涓婚敭ID</returns> + int AddOrderProduction(Dt_OutOrderProduction production); +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageOutOrderService/OutboundOrder/IDt_OutOrderService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageOutOrderService/OutboundOrder/IDt_OutOrderService.cs" new file mode 100644 index 0000000..91e5038 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageOutOrderService/OutboundOrder/IDt_OutOrderService.cs" @@ -0,0 +1,39 @@ +锘縩amespace WIDESEA_IStorageOutOrderServices; + +public interface IDt_OutOrderService : IService<Dt_OutOrder> +{ + /// <summary> + /// 娣诲姞鐢熶骇鍑哄簱鍗� + /// </summary> + /// <param name="model">鍑哄簱鏁版嵁</param> + /// <returns>鎴愬姛鎴栧け璐�</returns> + WebResponseContent AddOutOrderProduction(SaveModel model); + + /// <summary> + /// 娣诲姞璋冩嫧鍑哄簱鍗� + /// </summary> + /// <param name="model">鍑哄簱鏁版嵁</param> + /// <returns>鎴愬姛鎴栧け璐�</returns> + WebResponseContent AddOutOrderTransfer(SaveModel model); + + /// <summary> + /// 鏍规嵁鍑哄簱鍗曞彿鏌ヨ鍑哄簱璁㈠崟 + /// </summary> + /// <param name="orderNumber">鍑哄簱鍗曞彿</param> + /// <returns>鍑哄簱璁㈠崟</returns> + WebResponseContent GetOutOrderByNumber(string orderNumber); + + /// <summary> + /// 淇敼鍑哄簱璁㈠崟锛堝鑸慨鏀癸級 + /// </summary> + /// <param name="outOrder"></param> + /// <returns>鏄惁鎴愬姛</returns> + Task<bool> OutOrderUpdatedAsync(Dt_OutOrder outOrder); + + /// <summary> + /// 鏍规嵁璁㈠崟鍒嗛厤鍑哄簱搴撳瓨 + /// </summary> + /// <param name="orderNo">璁㈠崟缂栧彿</param> + /// <returns></returns> + Task<WebResponseContent> GetOutboundStockAsync(string orderNo); +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageOutOrderService/OutboundOrder/IDt_OutOrderTransferDetailService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageOutOrderService/OutboundOrder/IDt_OutOrderTransferDetailService.cs" new file mode 100644 index 0000000..4ab29a7 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageOutOrderService/OutboundOrder/IDt_OutOrderTransferDetailService.cs" @@ -0,0 +1,5 @@ +锘縩amespace WIDESEA_IStorageOutOrderServices; + +public interface IDt_OutOrderTransferDetailService : IService<Dt_OutOrderTransferDetail> +{ +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageOutOrderService/OutboundOrder/IDt_OutOrderTransferService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageOutOrderService/OutboundOrder/IDt_OutOrderTransferService.cs" new file mode 100644 index 0000000..bc29a1e --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageOutOrderService/OutboundOrder/IDt_OutOrderTransferService.cs" @@ -0,0 +1,5 @@ +锘縩amespace WIDESEA_IStorageOutOrderServices; + +public interface IDt_OutOrderTransferService : IService<Dt_OutOrderTransfer> +{ +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageTaskRepository/GlobalUsing.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageTaskRepository/GlobalUsing.cs" new file mode 100644 index 0000000..74a991a --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageTaskRepository/GlobalUsing.cs" @@ -0,0 +1,2 @@ +锘縢lobal using WIDESEA_Core.BaseRepository; +global using WIDESEA_Model.Models; \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageTaskRepository/Task/IDt_TaskRepository.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageTaskRepository/Task/IDt_TaskRepository.cs" new file mode 100644 index 0000000..e5ef596 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageTaskRepository/Task/IDt_TaskRepository.cs" @@ -0,0 +1,32 @@ +锘縩amespace WIDESEA_IStorageTaskRepository; + +public interface IDt_TaskRepository : IRepository<Dt_Task> +{ + Task<Dt_Task> GetById(int id); + + Task<List<Dt_Task>> GetList(); + + Task<Dt_Task> Create(Dt_Task model); + + Task<bool> Create(List<Dt_Task> models); + + Task<bool> Update(Dt_Task model); + + Task<bool> Update(List<Dt_Task> models); + + Task<bool> Delete(int id); + + Task<bool> Delete(List<int> ids); + + Task<List<Dt_Task>> GetListByOutOrder(int outOrderId); + + Task<List<Dt_Task>> GetListByOutOrderAndStatus(int outOrderId, int status); + + Task<List<Dt_Task>> GetListByStatus(int status); + + /// <summary> + /// 鑾峰彇浠诲姟缂栧彿 + /// </summary> + /// <returns></returns> + Task<int> GetTaskNo(); +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageTaskRepository/Task/IDt_Task_HtyRepository.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageTaskRepository/Task/IDt_Task_HtyRepository.cs" new file mode 100644 index 0000000..ec500f9 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageTaskRepository/Task/IDt_Task_HtyRepository.cs" @@ -0,0 +1,6 @@ +锘縩amespace WIDESEA_IStorageTaskRepository; + +public interface IDt_Task_HtyRepository : IRepository<Dt_Task_Hty> +{ + bool InsertTask(Dt_Task_Hty task); +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageTaskRepository/Task/ITaskExecuteDetailRepository.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageTaskRepository/Task/ITaskExecuteDetailRepository.cs" new file mode 100644 index 0000000..e7c46df --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageTaskRepository/Task/ITaskExecuteDetailRepository.cs" @@ -0,0 +1,13 @@ +锘縩amespace WIDESEA_IStorageTaskRepository; + +public interface ITaskExecuteDetailRepository : IRepository<Dt_TaskExecuteDetail> +{ + /// <summary> + /// 娣诲姞浠诲姟鏄庣粏 + /// </summary> + /// <param name="dt_Task">浠诲姟鏁版嵁</param> + /// <param name="isManual">鏄惁浜哄伐鎿嶄綔</param> + /// <param name="message">鎵ц淇℃伅</param> + /// <returns></returns> + Task<bool> AddDetailAsync(Dt_Task dt_Task, bool isManual, string message); +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageTaskService/GlobalUsing.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageTaskService/GlobalUsing.cs" new file mode 100644 index 0000000..d9777d7 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageTaskService/GlobalUsing.cs" @@ -0,0 +1,3 @@ +锘縢lobal using WIDESEA_Core; +global using WIDESEA_Core.BaseServices; +global using WIDESEA_Model.Models; \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageTaskService/Task/IDt_TaskService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageTaskService/Task/IDt_TaskService.cs" new file mode 100644 index 0000000..a13890e --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageTaskService/Task/IDt_TaskService.cs" @@ -0,0 +1,174 @@ +锘縰sing WIDESEA_DTO; + +namespace WIDESEA_IStorageTaskServices; + +public interface IDt_TaskService : IService<Dt_Task> +{ + /// <summary> + /// 閫氳繃ID鑾峰彇浠诲姟 + /// </summary> + /// <param name="id">浠诲姟ID</param> + /// <returns>浠诲姟妯″瀷</returns> + Task<Dt_Task> GetById(int id); + + /// <summary> + /// 鏍规嵁璐т綅ID鑾峰彇浠诲姟 + /// </summary> + /// <param name="locationID"></param> + /// <returns></returns> + Task<Dt_Task> GetByLocation(string locationID); + + /// <summary> + /// 鏍规嵁浠诲姟鍙疯幏鍙栦换鍔� + /// </summary> + /// <param name="taskNum"></param> + /// <returns></returns> + Task<Dt_Task> GetByTaskNum(int taskNum); + + /// <summary> + /// 鑾峰彇鎵�鏈変换鍔″垪琛� + /// </summary> + /// <returns>浠诲姟妯″瀷鍒楄〃</returns> + Task<List<Dt_Task>> GetList(); + + /// <summary> + /// 鍒涘缓涓�涓柊鐨勪换鍔� + /// </summary> + /// <param name="model">浠诲姟妯″瀷</param> + /// <returns>鍒涘缓鐨勪换鍔�</returns> + Task<Dt_Task> Create(Dt_Task model); + + /// <summary> + /// 鎵归噺鍒涘缓浠诲姟 + /// </summary> + /// <param name="models">浠诲姟妯″瀷鍒楄〃</param> + /// <returns>鏄惁鍒涘缓鎴愬姛</returns> + Task<bool> Create(List<Dt_Task> models); + + /// <summary> + /// 鏇存柊涓�涓换鍔� + /// </summary> + /// <param name="model">浠诲姟妯″瀷</param> + /// <returns>鏄惁鏇存柊鎴愬姛</returns> + Task<bool> Update(Dt_Task model); + + /// <summary> + /// 鎵归噺鏇存柊浠诲姟 + /// </summary> + /// <param name="models">浠诲姟妯″瀷鍒楄〃</param> + /// <returns>鏄惁鏇存柊鎴愬姛</returns> + Task<bool> Update(List<Dt_Task> models); + + /// <summary> + /// 鍒犻櫎涓�涓换鍔� + /// </summary> + /// <param name="id">浠诲姟ID</param> + /// <returns>鏄惁鍒犻櫎鎴愬姛</returns> + Task<bool> Delete(int id); + + /// <summary> + /// 鎵归噺鍒犻櫎浠诲姟 + /// </summary> + /// <param name="ids">浠诲姟ID鍒楄〃</param> + /// <returns>鏄惁鍒犻櫎鎴愬姛</returns> + Task<bool> Delete(List<int> ids); + + /// <summary> + /// 鏍规嵁鍑哄簱璁㈠崟ID鑾峰彇浠诲姟鍒楄〃 + /// </summary> + /// <param name="outOrderId">鍑哄簱璁㈠崟ID</param> + /// <returns>浠诲姟妯″瀷鍒楄〃</returns> + Task<List<Dt_Task>> GetListByOutOrder(int outOrderId); + + /// <summary> + /// 鏍规嵁鍑哄簱璁㈠崟ID鍜岀姸鎬佽幏鍙栦换鍔″垪琛� + /// </summary> + /// <param name="outOrderId">鍑哄簱璁㈠崟ID</param> + /// <param name="status">浠诲姟鐘舵��</param> + /// <returns>浠诲姟妯″瀷鍒楄〃</returns> + Task<List<Dt_Task>> GetListByOutOrderAndStatus(int outOrderId, int status); + + /// <summary> + /// 鏍规嵁鐘舵�佽幏鍙栦换鍔″垪琛� + /// </summary> + /// <param name="status">浠诲姟鐘舵��</param> + /// <returns>浠诲姟妯″瀷鍒楄〃</returns> + Task<List<Dt_Task>> GetListByStatus(int status); + + /// <summary> + /// 妫�鏌ヤ换鍔℃槸鍚﹀瓨鍦� + /// </summary> + /// <param name="palletCode">鎵樼洏缂栫爜</param> + /// <returns>浠诲姟鏄惁瀛樺湪</returns> + bool IsExist(string palletCode); + + /// <summary> + /// 鍫嗗灈鏈轰换鍔″畬鎴� + /// </summary> + /// <param name="saveModel">浠诲姟鏁版嵁鍚堥泦</param> + /// <returns>杩斿洖缁撴灉闆�</returns> + //abstract Task<WebResponseContent> CompleteStackTaskAsync(Dt_Task task, DtStockInfo stock); + + /// <summary> + /// 绉诲簱浠诲姟瀹屾垚 + /// </summary> + /// <param name="saveModel">浠诲姟鏁版嵁鍚堥泦</param> + /// <returns>杩斿洖缁撴灉闆�</returns> + abstract Task<WebResponseContent> CompleteTransferTaskAsync(Dt_Task task, Dt_WheelsStock stock); + + /// <summary> + /// 浠诲姟瀹屾垚 + /// </summary> + /// <param name="saveModel"></param> + /// <returns></returns> + Task<WebResponseContent> CompleteAsync(int taskNum); + + /// <summary> + /// 涓婃枡璇锋眰 + /// </summary> + /// <param name="input">璇锋眰鍙傛暟</param> + /// <returns></returns> + Task<WebResponseContent> RequestInTask(RequestTaskDto input); + + /// <summary> + /// 鏇存柊涓烘娴嬩换鍔� + /// </summary> + /// <param name="input"></param> + /// <returns></returns> + Task<WebResponseContent> UpdateCheckTask(RequestTaskDto input); + + /// <summary> + /// 璇锋眰娴佸悜鍒嗛厤 + /// </summary> + /// <param name="input"></param> + /// <returns></returns> + Task<WebResponseContent> RequestWheelsFlow(RequestTaskDto input); + + /// <summary> + /// 璇锋眰浠诲姟璐т綅 + /// </summary> + /// <param name="input"></param> + /// <returns></returns> + Task<WebResponseContent> UpdateExistingTask(RequestTaskDto input); + + + + + /// <summary> + /// 浠诲姟鐘舵�佷慨鏀� + /// </summary> + /// <param name="input">璇锋眰鏁版嵁</param> + /// <returns></returns> + Task<WebResponseContent> UpdateTaskStatus(int taskNum, int taskState); + + + /// <summary> + /// 鍒涘缓鎸囧畾浠诲姟 + /// </summary> + /// <param name="locationCode">璐т綅鍙�</param> + /// <param name="palletCode">鎵樼洏鍙�</param> + /// <returns></returns> + WebResponseContent CreateAndSendOutboundTask(SaveModel saveModel); + + +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageTaskService/Task/IDt_Task_HtyService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageTaskService/Task/IDt_Task_HtyService.cs" new file mode 100644 index 0000000..6d622b8 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageTaskService/Task/IDt_Task_HtyService.cs" @@ -0,0 +1,11 @@ +锘縩amespace WIDESEA_IStorageTaskServices; + +public interface IDt_Task_HtyService : IService<Dt_Task_Hty> +{ + /// <summary> + /// 娣诲姞鍘嗗彶浠诲姟 + /// </summary> + /// <param name="task">鍘嗗彶浠诲姟Model</param> + /// <returns>鎴愬姛/澶辫触</returns> + bool InsertTask(Dt_Task_Hty task); +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageTaskService/Task/ITaskExecuteDetailService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageTaskService/Task/ITaskExecuteDetailService.cs" new file mode 100644 index 0000000..aaaeeed --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageTaskService/Task/ITaskExecuteDetailService.cs" @@ -0,0 +1,6 @@ +锘縩amespace WIDESEA_IStorageTaskServices; + +public interface ITaskExecuteDetailService : IService<Dt_TaskExecuteDetail> +{ + +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/LoginInfo.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/LoginInfo.cs" new file mode 100644 index 0000000..678745b --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/LoginInfo.cs" @@ -0,0 +1,15 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WIDESEA_Model +{ + public class LoginInfo + { + public string UserName { get; set; } + + public string Password { get; set; } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Basic/Dt_AreaInfo.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Basic/Dt_AreaInfo.cs" new file mode 100644 index 0000000..1251671 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Basic/Dt_AreaInfo.cs" @@ -0,0 +1,103 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using SqlSugar; +using WIDESEA_Core.DB.Models; +namespace WIDESEA_Model.Models +{ + /// <summary> + /// 鍖哄煙琛� + ///</summary> + [SugarTable("Dt_AreaInfo")] + public class Dt_AreaInfo : BaseEntity + { + + + /// <summary> + /// 澶� 娉�:鍖哄煙ID + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName="AreaID" ,IsPrimaryKey = true,IsIdentity = true) ] + public int AreaID { get; set; } + + /// <summary> + /// 澶� 娉�:鍖哄煙缂栫爜 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName="AreaCode" ) ] + public string AreaCode { get; set; } = null!; + + /// <summary> + /// 澶� 娉�:鍖哄煙鍚嶇О + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName="AreaName" ) ] + public string? AreaName { get; set; } + + /// <summary> + /// 澶� 娉�:鍖哄煙绫诲瀷 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName="AreaType" ) ] + public string? AreaType { get; set; } + + /// <summary> + /// 澶� 娉�:鍖哄煙鎻忚堪 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName="AreaDesc" ) ] + public string? AreaDesc { get; set; } + + /// <summary> + /// 澶� 娉�:鍖哄煙鐘舵�� + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName="AreaStatus" ) ] + public int? AreaStatus { get; set; } + + + + /// <summary> + /// 澶� 娉�: 鍖哄煙鐐逛綅 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName="Spare1" ) ] + public string? Spare1 { get; set; } + + /// <summary> + /// 澶� 娉�: 瀵瑰簲MOM鍖哄煙缂栫爜 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName="Spare2" ) ] + public string? Spare2 { get; set; } + + /// <summary> + /// 澶� 娉�: 涓婁綅杞欢鍚嶇О + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName="Spare3" ) ] + public string? Spare3 { get; set; } + + /// <summary> + /// 澶� 娉�: + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName="Spare4" ) ] + public string? Spare4 { get; set; } + + /// <summary> + /// 澶� 娉�: + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName="Spare5" ) ] + public string? Spare5 { get; set; } + + /// <summary> + /// 搴撳尯鏄庣粏 + /// </summary> + [SugarColumn(ColumnName = "搴撳尯鏄庣粏")] + [Navigate(NavigateType.OneToMany, nameof(Dt_WareAreaInfo.AreaID))] + public List<Dt_WareAreaInfo> Dt_WareAreaInfoDetailList { get; set; } + } + +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Basic/Dt_MaterielAttribute.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Basic/Dt_MaterielAttribute.cs" new file mode 100644 index 0000000..192f1e6 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Basic/Dt_MaterielAttribute.cs" @@ -0,0 +1,116 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using SqlSugar; +using WIDESEA_Core.DB.Models; +namespace WIDESEA_Model.Models +{ + /// <summary> + /// 鐗╂枡灞炴�ц〃 + ///</summary> + [SugarTable("Dt_MaterielAttribute")] + public class Dt_MaterielAttribute : BaseEntity + { + + + /// <summary> + /// 澶� 娉�:灞炴�D + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName="AttributeID" ,IsPrimaryKey = true,IsIdentity = true) ] + public int AttributeID { get; set; } + + /// <summary> + /// 澶� 娉�:鐗╂枡ID + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName="MaterielID" ) ] + public int? MaterielID { get; set; } + + /// <summary> + /// 澶� 娉�:灞炴�х紪鐮� + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName="AttributeCode" ) ] + public string? AttributeCode { get; set; } + + /// <summary> + /// 澶� 娉�:鐗╂枡灞炴�у悕绉� + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName="AttributeName" ) ] + public string? AttributeName { get; set; } + + /// <summary> + /// 澶� 娉�:鐗╂枡灞炴�ф弿杩� + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName="AttributeDesc" ) ] + public string? AttributeDesc { get; set; } + + /// <summary> + /// 澶� 娉�:瀛樺偍鏉′欢 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName="Stroagecon" ) ] + public string? Stroagecon { get; set; } + + /// <summary> + /// 澶� 娉�:杩愯緭鏉′欢 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName="Transpcon" ) ] + public string? Transpcon { get; set; } + + /// <summary> + /// 澶� 娉�: + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName="Remark" ) ] + public string? Remark { get; set; } + + + /// <summary> + /// 澶� 娉�: + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName="Spare1" ) ] + public string? Spare1 { get; set; } + + /// <summary> + /// 澶� 娉�: + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName="Spare2" ) ] + public string? Spare2 { get; set; } + + /// <summary> + /// 澶� 娉�: + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName="Spare3" ) ] + public string? Spare3 { get; set; } + + /// <summary> + /// 澶� 娉�: + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName="Spare4" ) ] + public string? Spare4 { get; set; } + + /// <summary> + /// 澶� 娉�: + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName="Spare5" ) ] + public string? Spare5 { get; set; } + + /// <summary> + /// 鐗╂枡灞炴�� + /// </summary> + [SugarColumn(ColumnName = "鐗╂枡灞炴�� ")] + [Navigate(NavigateType.OneToMany, nameof(Dt_MaterielAttribute.MaterielID))] + public List<Dt_MaterielAttribute> Dt_MaterielAttributeList { get; set; } + } + +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Basic/Dt_MaterielInfo.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Basic/Dt_MaterielInfo.cs" new file mode 100644 index 0000000..80fe168 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Basic/Dt_MaterielInfo.cs" @@ -0,0 +1,95 @@ +using SqlSugar; +using WIDESEA_Core.DB.Models; + +namespace WIDESEA_Model.Models; + +/// <summary> +/// 鐗╂枡鍩烘湰淇℃伅琛� +///</summary> +[SugarTable("Dt_MaterielInfo")] +public class Dt_MaterielInfo : BaseEntity +{ + /// <summary> + /// 澶� 娉�:鐗╂枡ID + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "MaterielID", IsPrimaryKey = true, IsIdentity = true)] + public int MaterielID { get; set; } + + /// <summary> + /// 澶� 娉�:鐗╂枡缂栫爜 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "MaterielCode", IsNullable = false)] + public string? MaterielCode { get; set; } + + /// <summary> + /// 澶� 娉�:鐗╂枡鍚嶇О + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "MaterielName", IsNullable = false)] + public string? MaterielName { get; set; } + + /// <summary> + /// 澶� 娉�:鐗╂枡鎻忚堪 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "MaterielDesc", IsNullable = true)] + public string? MaterielDesc { get; set; } + + /// <summary> + /// 澶� 娉�:褰撳墠鐘舵�侊紙0锛岀鐢� 1锛屽惎鐢級 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "Status", IsNullable = false)] + public int? Status { get; set; } + + /// <summary> + /// 澶� 娉�:鏈�灏忓寘瑁呮暟 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "MinpackQty", IsNullable = true)] + public decimal? MinpackQty { get; set; } + + /// <summary> + /// 澶� 娉�:鐢熶骇鍟� + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "Mfacturer", IsNullable = true)] + public string? Mfacturer { get; set; } + + /// <summary> + /// 澶� 娉�:鍑�閲� + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "Netweight", IsNullable = true)] + public decimal? Netweight { get; set; } + + /// <summary> + /// 澶� 娉�:姣涢噸 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "Grossweight", IsNullable = true)] + public decimal? Grossweight { get; set; } + + /// <summary> + /// 澶� 娉�:鏈夋晥鏈� + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "Validity", IsNullable = true)] + public int? Validity { get; set; } + + /// <summary> + /// 澶� 娉�:瀹夊叏搴撳瓨 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "Safety", IsNullable = true)] + public decimal? Safety { get; set; } + + /// <summary> + /// 澶� 娉�:澶囨敞 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "Remark", IsNullable = true)] + public string? Remark { get; set; } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Basic/Dt_RoadWayInfo.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Basic/Dt_RoadWayInfo.cs" new file mode 100644 index 0000000..3808568 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Basic/Dt_RoadWayInfo.cs" @@ -0,0 +1,90 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using SqlSugar; +using WIDESEA_Core.DB.Models; +namespace WIDESEA_Model.Models +{ + /// <summary> + /// 宸烽亾鍙� + ///</summary> + [SugarTable("Dt_RoadWayInfo")] + public class Dt_RoadWayInfo : BaseEntity + { + + + /// <summary> + /// 澶� 娉�:宸烽亾ID + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName="RoadwayID" ,IsPrimaryKey = true,IsIdentity = true) ] + public int RoadwayID { get; set; } + + /// <summary> + /// 澶� 娉�:宸烽亾鍙� + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName="RoadWayNO" ) ] + public string? RoadWayNO { get; set; } + + /// <summary> + /// 澶� 娉�:搴撳尯ID + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName="WareAreaID" ) ] + public int? WareAreaID { get; set; } + + /// <summary> + /// 澶� 娉�:鏄惁鍚敤 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName="IsEnable" ) ] + public bool? IsEnable { get; set; } + + /// <summary> + /// 澶� 娉�:澶囨敞 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName="Remark" ) ] + public string? Remark { get; set; } + + + /// <summary> + /// 澶� 娉�: + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName="Spare1" ) ] + public string? Spare1 { get; set; } + + /// <summary> + /// 澶� 娉�: + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName="Spare2" ) ] + public string? Spare2 { get; set; } + + /// <summary> + /// 澶� 娉�: + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName="Spare3" ) ] + public string? Spare3 { get; set; } + + /// <summary> + /// 澶� 娉�: + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName="Spare4" ) ] + public string? Spare4 { get; set; } + + /// <summary> + /// 澶� 娉�: + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName="Spare5" ) ] + public string? Spare5 { get; set; } + + + } + +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Basic/Dt_Strategy.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Basic/Dt_Strategy.cs" new file mode 100644 index 0000000..2f10100 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Basic/Dt_Strategy.cs" @@ -0,0 +1,126 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using SqlSugar; +using WIDESEA_Core.DB.Models; +namespace WIDESEA_Model.Models +{ + /// <summary> + /// 绛栫暐琛� + ///</summary> + [SugarTable("Dt_Strategy")] + public class Dt_Strategy : BaseEntity + { + + + /// <summary> + /// 澶� 娉�: + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName="StrategyId" ,IsPrimaryKey = true,IsIdentity = true) ] + public int StrategyId { get; set; } + + /// <summary> + /// 澶� 娉�:绛栫暐缂栫爜 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName="StrategyCode" ) ] + public string? StrategyCode { get; set; } + + /// <summary> + /// 澶� 娉�:绛栫暐鍚嶇О + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName="StrategyName" ) ] + public string? StrategyName { get; set; } + + /// <summary> + /// 澶� 娉�:瀛楁鏉ユ簮 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName="FiledSource" ) ] + public string? FiledSource { get; set; } + + /// <summary> + /// 澶� 娉�:瑙勫垯瀛楁 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName="FieldName" ) ] + public string? FieldName { get; set; } + + /// <summary> + /// 澶� 娉�:鎺掑簭鏂瑰紡 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName="SordOrder" ) ] + public string? SordOrder { get; set; } + + /// <summary> + /// 澶� 娉�:瑙勫垯鎵ц椤哄簭 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName="ExecutionOrder" ) ] + public int? ExecutionOrder { get; set; } + + /// <summary> + /// 澶� 娉�:绛栫暐绫诲瀷锛�1锛屽叆搴� 2锛屽嚭搴擄級 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName="StrategyType" ) ] + public string? StrategyType { get; set; } + + /// <summary> + /// 澶� 娉�:鏄惁棰勮 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName="IsPreset" ) ] + public bool? IsPreset { get; set; } + + /// <summary> + /// 澶� 娉�:澶囨敞 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName="Remark" ) ] + public string? Remark { get; set; } + + + + /// <summary> + /// 澶� 娉�: + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName="Spare1" ) ] + public string? Spare1 { get; set; } + + /// <summary> + /// 澶� 娉�: + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName="Spare2" ) ] + public string? Spare2 { get; set; } + + /// <summary> + /// 澶� 娉�: + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName="Spare3" ) ] + public string? Spare3 { get; set; } + + /// <summary> + /// 澶� 娉�: + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName="Spare4" ) ] + public string? Spare4 { get; set; } + + /// <summary> + /// 澶� 娉�: + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName="Spare5" ) ] + public string? Spare5 { get; set; } + + + } + +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Basic/Dt_Task.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Basic/Dt_Task.cs" new file mode 100644 index 0000000..12f48a2 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Basic/Dt_Task.cs" @@ -0,0 +1,197 @@ +using SqlSugar; +using WIDESEA_Core.DB.Models; + +namespace WIDESEA_Model.Models; + +/// <summary> +/// 浠诲姟琛� +///</summary> +[SugarTable("Dt_Task", "浠诲姟琛�")] +public class Dt_Task : BaseEntity +{ + /// <summary> + /// 澶� 娉�:涓婚敭 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "TaskId", IsPrimaryKey = true, IsIdentity = true)] + public int TaskId { get; set; } + + /// <summary> + /// 澶� 娉�:浠诲姟鍙� + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "TaskNum")] + public int? TaskNum { get; set; } + + /// <summary> + /// 澶� 娉�:鎵樼洏缂栧彿 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "PalletCode", Length = 50)] + public string? PalletCode { get; set; } + + /// <summary> + /// 澶� 娉�:鍗曟嵁缂栧彿 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "OrderNo", Length = 30, IsNullable = true)] + public string? OrderNo { get; set; } + + /// <summary> + /// 澶� 娉�:宸烽亾 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "Roadway", Length = 30, IsNullable = true)] + public string? Roadway { get; set; } + + /// <summary> + /// 澶� 娉�:浠诲姟绫诲瀷锛�100 鍑哄簱;鐩樼偣鍑哄簱 101; 102 鍒嗘嫞鍑哄簱;103 璐ㄦ鍑哄簱;200 鍏ュ簱;鐩樼偣鍏ュ簱 201;鍒嗘嫞鍏ュ簱 202;璐ㄦ鍏ュ簱 203;绉诲簱 300;搴撳唴绉诲簱 301;搴撳绉诲簱 302 锛� + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "TaskType")] + public int TaskType { get; set; } + + /// <summary> + /// 澶� 娉�:浠诲姟鐘舵�侊紙0鏂板缓鍏ュ簱浠诲姟锛� 100GV鍏ュ簱鎵ц涓紝 101 AGV鍏ュ簱瀹屾垚锛� 102杈撻�佺嚎鍏ュ簱鎵ц涓紝 103杈撻�佺嚎鍏ュ簱瀹屾垚锛� 104鍫嗗灈鏈哄叆搴撴墽琛屼腑锛� 105鍫嗗灈鏈哄叆搴撳畬鎴愶紝 106鍏ュ簱浠诲姟瀹屾垚锛�107鍏ュ簱浠诲姟鍙栨秷 锛� + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "TaskState")] + public int? TaskState { get; set; } + + /// <summary> + /// 澶� 娉�:鐗╂枡缂栧彿 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "MaterialNo", Length = 30, IsNullable = true)] + public string? MaterialNo { get; set; } + + /// <summary> + /// 澶� 娉�:璧峰鍦板潃 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "SourceAddress", Length = 30)] + public string? SourceAddress { get; set; } + + /// <summary> + /// 澶� 娉�:鐩爣鍦板潃 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "TargetAddress", Length = 30)] + public string? TargetAddress { get; set; } + + /// <summary> + /// 澶� 娉�:褰撳墠浣嶇疆 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "CurrentAddress", Length = 30)] + public string? CurrentAddress { get; set; } + + /// <summary> + /// 澶� 娉�:涓嬩竴鍦板潃 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "NextAddress", Length = 30)] + public string? NextAddress { get; set; } + + /// <summary> + /// 澶� 娉�:浼樺厛绾� + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "Grade")] + public int? Grade { get; set; } + + /// <summary> + /// 澶� 娉�:浠诲姟涓嬪彂鏃堕棿 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "Dispatchertime")] + public DateTime? Dispatchertime { get; set; } + + /// <summary> + /// 澶� 娉�:澶囨敞 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "Remark", Length = 100, IsNullable = true)] + public string? Remark { get; set; } + + /// <summary> + /// 澶� 娉�: + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "ErrorMessage", Length = 100, IsNullable = true)] + public string? ErrorMessage { get; set; } + + + /// <summary> + /// 浠诲姟鎵ц鏄庣粏 + /// </summary> + [SugarColumn(ColumnName = "浠诲姟鎵ц鏄庣粏")] + [Navigate(NavigateType.OneToMany, nameof(Dt_TaskExecuteDetail.TaskId))] + public List<Dt_TaskExecuteDetail> Dt_TaskExecuteDetailList { get; set; } + + + ///// <summary> + ///// 娴嬮噺宸ヤ欢绫诲瀷 + ///// </summary> + //[SugarColumn(ColumnName = "StockType", Length = 10)] + //public string WheelsType { get; set; } + + /// <summary> + /// 杞﹀瀷 + /// </summary> + [SugarColumn(ColumnName = "CarType", Length = 20)] + public string CarType { get; set; } + + /// <summary> + /// 鏂版棫 + /// </summary> + [SugarColumn(ColumnName = "WheelsNewOrOld", Length = 20)] + public string WheelsNewOrOld { get; set; } + + ///// <summary> + ///// 绛夌骇 + ///// </summary> + //[SugarColumn(ColumnName = "WheelsLevel", Length = 20)] + //public string WheelsLevel { get; set; } + + /// <summary> + /// 鏄惁娴嬮噺 + /// </summary> + [SugarColumn(IsNullable = true, ColumnDescription = "鏄惁娴嬮噺")] + public bool IsCheck { get; set; } = true; + + /// <summary> + /// 澶� 娉�:娴嬮噺鏁版嵁 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "task_bak1", ColumnDescription = "娴嬮噺鏁版嵁")] + public string task_bak1 { get; set; } + + /// <summary> + /// 澶� 娉�:杞﹁酱鍙� + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "task_CZInfo", Length = 255, ColumnDescription = "杞﹁酱鍙�")] + public string task_CZInfo { get; set; } + + /// <summary> + /// 澶� 娉�:姣傚瓟鍧囧�� + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "wheels_gkcc", Length = 255, ColumnDescription = "姣傚瓟鍧囧��")] + public string wheels_gkcc { get; set; } + + /// <summary> + /// 澶� 娉�:鍔ㄦ嫋灞炴�� + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "Wheels_mttype", Length = 255, ColumnDescription = "鍔ㄦ嫋灞炴��")] + public string wheels_mttype { get; set; } + + /// <summary> + /// 杞瀷 + ///</summary> + [SugarColumn(ColumnName = "WheelsLX", Length = 255, ColumnDescription = "杞瀷")] + public string WheelsLX { get; set; } + +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Basic/Dt_TaskExecuteDetail.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Basic/Dt_TaskExecuteDetail.cs" new file mode 100644 index 0000000..c427688 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Basic/Dt_TaskExecuteDetail.cs" @@ -0,0 +1,57 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using SqlSugar; +using WIDESEA_Core.DB.Models; +namespace WIDESEA_Model.Models +{ + /// <summary> + /// 浠诲姟鎵ц鏄庣粏琛� + ///</summary> + [SugarTable("Dt_TaskExecuteDetail")] + public class Dt_TaskExecuteDetail : BaseEntity + { + /// <summary> + /// 澶� 娉�: + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName="TaskDetailId" ,IsPrimaryKey = true,IsIdentity = true) ] + public int TaskDetailId { get; set; } + + /// <summary> + /// 澶� 娉�: + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName="TaskId" ) ] + public int? TaskId { get; set; } + + /// <summary> + /// 澶� 娉�:浠诲姟鍙� + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName="TaskNum" ) ] + public int? TaskNum { get; set; } + + /// <summary> + /// 澶� 娉�:浠诲姟鐘舵�� + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName="TaskState" ) ] + public int? TaskState { get; set; } + + /// <summary> + /// 澶� 娉�:鏄惁浜哄伐鎿嶄綔 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName="IsManual" ) ] + public bool? IsManual { get; set; } + + /// <summary> + /// 澶� 娉�:澶囨敞 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName="Remark" ) ] + public string? Remark { get; set; } + } + +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Basic/Dt_Task_Hty.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Basic/Dt_Task_Hty.cs" new file mode 100644 index 0000000..005f178 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Basic/Dt_Task_Hty.cs" @@ -0,0 +1,31 @@ +锘縰sing SqlSugar; + +namespace WIDESEA_Model.Models; + +/// <summary> +/// 浠诲姟琛� +///</summary> +[SugarTable("Dt_Task_Hty", "浠诲姟鍘嗗彶琛�")] +public class Dt_Task_Hty : Dt_Task +{ + /// <summary> + /// 澶� 娉�: 瀹屾垚鏃堕棿 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "FinishTime", ColumnDescription = "瀹屾垚鏃堕棿")] + public DateTime FinishTime { get; set; } + + /// <summary> + /// 澶� 娉�: 鎿嶄綔绫诲瀷 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "OperateType", ColumnDescription = "鎿嶄綔绫诲瀷")] + public int OperateType { get; set; } + + /// <summary> + /// 澶� 娉�: 婧愬崟ID + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "SourceId", ColumnDescription = "婧愬崟ID")] + public int SourceId { get; set; } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Basic/Dt_TypeMapping.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Basic/Dt_TypeMapping.cs" new file mode 100644 index 0000000..55f6da8 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Basic/Dt_TypeMapping.cs" @@ -0,0 +1,84 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using SqlSugar; +using WIDESEA_Core.DB.Models; +namespace WIDESEA_Model.Models +{ + /// <summary> + /// 鍗曟嵁/浠诲姟绫诲瀷鍏崇郴琛� + ///</summary> + [SugarTable("Dt_TypeMapping")] + public class Dt_TypeMapping : BaseEntity + { + + + /// <summary> + /// 澶� 娉�: + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName="Id" ,IsPrimaryKey = true,IsIdentity = true) ] + public int Id { get; set; } + + /// <summary> + /// 澶� 娉�:鍗曟嵁绫诲瀷 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName="OrderType" ) ] + public int OrderType { get; set; } + + /// <summary> + /// 澶� 娉�:浠诲姟绫诲瀷 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName="TaskType" ) ] + public int TaskType { get; set; } + + /// <summary> + /// 澶� 娉�: + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName="Remark" ) ] + public string? Remark { get; set; } + + + + /// <summary> + /// 澶� 娉�: + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName="Spare1" ) ] + public string? Spare1 { get; set; } + + /// <summary> + /// 澶� 娉�: + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName="Spare2" ) ] + public string? Spare2 { get; set; } + + /// <summary> + /// 澶� 娉�: + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName="Spare3" ) ] + public string? Spare3 { get; set; } + + /// <summary> + /// 澶� 娉�: + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName="Spare4" ) ] + public string? Spare4 { get; set; } + + /// <summary> + /// 澶� 娉�: + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName="Spare5" ) ] + public string? Spare5 { get; set; } + + + } + +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Basic/Dt_UnitInfo.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Basic/Dt_UnitInfo.cs" new file mode 100644 index 0000000..5cdfae4 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Basic/Dt_UnitInfo.cs" @@ -0,0 +1,111 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using SqlSugar; +using WIDESEA_Core.DB.Models; +namespace WIDESEA_Model.Models +{ + /// <summary> + /// 鍗曚綅淇℃伅琛� + ///</summary> + [SugarTable("Dt_UnitInfo")] + public class Dt_UnitInfo : BaseEntity + { + + + /// <summary> + /// 澶� 娉�:鍗曚綅浠g爜 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName="UnitID" ,IsPrimaryKey = true,IsIdentity = true) ] + public int UnitID { get; set; } + + /// <summary> + /// 澶� 娉�:鍗曚綅浠g爜 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName="UnitCode" ) ] + public string? UnitCode { get; set; } + + /// <summary> + /// 澶� 娉�:鍗曚綅鍚嶇О + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName="UnitName" ) ] + public string? UnitName { get; set; } + + /// <summary> + /// 澶� 娉�:鍖呰鍗曚綅 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName="PackUnit" ) ] + public string? PackUnit { get; set; } + + /// <summary> + /// 澶� 娉�:鍖呰鍗曚綅閲� + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName="PackUnitNum" ) ] + public decimal? PackUnitNum { get; set; } + + /// <summary> + /// 澶� 娉�:鏈�灏忓崟浣嶉噺 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName="MinUnitNum" ) ] + public decimal? MinUnitNum { get; set; } + + /// <summary> + /// 澶� 娉�:鎻忚堪 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName="UnitDesc" ) ] + public string? UnitDesc { get; set; } + + /// <summary> + /// 澶� 娉�: + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName="Remark" ) ] + public string? Remark { get; set; } + + + /// <summary> + /// 澶� 娉�: + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName="Spare1" ) ] + public string? Spare1 { get; set; } + + /// <summary> + /// 澶� 娉�: + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName="Spare2" ) ] + public string? Spare2 { get; set; } + + /// <summary> + /// 澶� 娉�: + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName="Spare3" ) ] + public string? Spare3 { get; set; } + + /// <summary> + /// 澶� 娉�: + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName="Spare4" ) ] + public string? Spare4 { get; set; } + + /// <summary> + /// 澶� 娉�: + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName="Spare5" ) ] + public string? Spare5 { get; set; } + + + } + +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Basic/Dt_WareAreaInfo.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Basic/Dt_WareAreaInfo.cs" new file mode 100644 index 0000000..66358ca --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Basic/Dt_WareAreaInfo.cs" @@ -0,0 +1,60 @@ +using SqlSugar; +using WIDESEA_Core.DB.Models; + +namespace WIDESEA_Model.Models; + +/// <summary> +/// 搴撳尯琛� +///</summary> +[SugarTable("Dt_WareAreaInfo")] +public class Dt_WareAreaInfo : BaseEntity +{ + /// <summary> + /// 澶� 娉�: 涓婚敭 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "WareAreaID", IsPrimaryKey = true, IsIdentity = true)] + public int WareAreaID { get; set; } + + /// <summary> + /// 澶� 娉�: 鍖哄煙ID + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "AreaID")] + public int AreaID { get; set; } + + /// <summary> + /// 澶� 娉�:搴撳尯浠g爜 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "WareAreaCode")] + public string WareAreaCode { get; set; } = null!; + + /// <summary> + /// 澶� 娉�:搴撳尯鍚嶇О + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "WareAreaName")] + public string? WareAreaName { get; set; } + + /// <summary> + /// 澶� 娉�:搴撳尯绫诲瀷 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "WareAreaType")] + public string? WareAreaType { get; set; } + + /// <summary> + /// 澶� 娉�:搴撳尯鎻忚堪 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "WareAreaDesc")] + public string? WareAreaDesc { get; set; } + + /// <summary> + /// 澶� 娉�:鐘舵�� + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "Status")] + public int? Status { get; set; } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/BasicInfo/Dt_StationManager.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/BasicInfo/Dt_StationManager.cs" new file mode 100644 index 0000000..16242bb --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/BasicInfo/Dt_StationManager.cs" @@ -0,0 +1,107 @@ +锘�#region << 鐗� 鏈� 娉� 閲� >> +/*---------------------------------------------------------------- + * 鍛藉悕绌洪棿锛歐IDESEAWCS_Model.Models.TaskInfo + * 鍒涘缓鑰咃細鑳$搴� + * 鍒涘缓鏃堕棿锛�2024/8/2 16:13:36 + * 鐗堟湰锛歏1.0.0 + * 鎻忚堪锛� + * + * ---------------------------------------------------------------- + * 淇敼浜猴細 + * 淇敼鏃堕棿锛� + * 鐗堟湰锛歏1.0.1 + * 淇敼璇存槑锛� + * + *----------------------------------------------------------------*/ +#endregion << 鐗� 鏈� 娉� 閲� >> + +using Magicodes.ExporterAndImporter.Core; +using SqlSugar; +using WIDESEA_Core.DB.Models; + +namespace WIDESEAWCS_Model.Models +{ + [SugarTable(nameof(Dt_StationManager), "绔欏彴淇℃伅")] + public class Dt_StationManager : BaseEntity + { + /// <summary> + /// 涓婚敭 + /// </summary> + [ImporterHeader(Name = "涓婚敭")] + [ExporterHeader(DisplayName = "涓婚敭")] + [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "涓婚敭")] + public int stationID { get; set; } + + /// <summary> + /// 绔欏彴绫诲瀷 1-鍏ュ簱绔欏彴 2-鍑哄簱绔欏彴 3-寮傚父鎺掑嚭绔欏彴 4-NG宸ョ珯鏀炬枡 5-NG宸ョ珯鍙栨枡 6-绌烘鍏ュ簱 7-绌烘鍑哄簱 + /// </summary> + [ImporterHeader(Name = "绔欏彴绫诲瀷")] + [ExporterHeader(DisplayName = "绔欏彴绫诲瀷")] + [SugarColumn(IsNullable = false, ColumnDescription = "绔欏彴绫诲瀷")] + public int stationType { get; set; } + + /// <summary> + /// 鎵�灞濸LC + /// </summary> + [ImporterHeader(Name = "鎵�灞濸LC")] + [ExporterHeader(DisplayName = "鎵�灞濸LC")] + [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "鎵�灞濸LC")] + public string stationPLC { get; set; } + + /// <summary> + /// 宸烽亾鍙� + /// </summary> + [ImporterHeader(Name = "宸烽亾鍙�")] + [ExporterHeader(DisplayName = "宸烽亾鍙�")] + [SugarColumn(IsNullable = false, Length = 10, ColumnDescription = "宸烽亾鍙�")] + public string Roadway { get; set; } + + /// <summary> + /// 澶囨敞 + /// </summary> + [ImporterHeader(Name = "澶囨敞")] + [ExporterHeader(DisplayName = "澶囨敞")] + [SugarColumn(IsNullable = false, ColumnDescription = "澶囨敞")] + public string stationRemark { get; set; } + + /// <summary> + /// 绾夸綋缂栧彿(瀛愯澶囩紪鍙�) + /// </summary> + [ImporterHeader(Name = "绾夸綋缂栧彿(瀛愯澶囩紪鍙�)")] + [ExporterHeader(DisplayName = "绾夸綋缂栧彿(瀛愯澶囩紪鍙�)")] + [SugarColumn(IsNullable = false, ColumnDescription = "绾夸綋缂栧彿(瀛愯澶囩紪鍙�)")] + public string stationChildCode { get; set; } + + /// <summary> + /// 璁惧鍖哄煙 + /// </summary> + [ImporterHeader(Name = "璁惧鍖哄煙")] + [ExporterHeader(DisplayName = "璁惧鍖哄煙")] + [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "璁惧鍖哄煙")] + public string stationArea { get; set; } + + /// <summary> + /// 鍧愭爣鍦板潃 + /// </summary> + [ImporterHeader(Name = "鍧愭爣鍦板潃")] + [ExporterHeader(DisplayName = "鍧愭爣鍦板潃")] + [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "鍧愭爣鍦板潃")] + public string stationLocation { get; set; } + + + /// <summary> + /// + /// </summary> + [SugarColumn(IsNullable = false, ColumnDescription = "NG瀛愯澶囩紪鍙�")] + public string stationNGChildCode { get; set; } + + /// <summary> + /// + /// </summary> + [SugarColumn(IsNullable = false, ColumnDescription = "NG瀛愯澶囧潗鏍�")] + public string stationNGLocation { get; set; } + public string remark { get; set; } + + public string stationStatus { get; set; } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/BasicInfo/Dt_Traintype.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/BasicInfo/Dt_Traintype.cs" new file mode 100644 index 0000000..e051516 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/BasicInfo/Dt_Traintype.cs" @@ -0,0 +1,46 @@ +锘縰sing Magicodes.ExporterAndImporter.Core; +using SqlSugar; +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Text; +using WIDESEA_Core.DB.Models; +using WIDESEA_Model.Models; + +namespace WIDESEAWCS_Model.Models +{ + [SugarTable(nameof(Dt_Traintype), "杞﹀瀷绠$悊")] + public class Dt_Traintype : BaseEntity + { + /// <summary> + /// 涓婚敭 + /// </summary> + [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "涓婚敭")] + public int Id { get; set; } + + /// <summary> + /// 杞﹀瀷浠g爜 + /// </summary> + [ImporterHeader(Name = "杞﹀瀷浠g爜")] + [ExporterHeader(DisplayName = "杞﹀瀷浠g爜")] + [SugarColumn(IsNullable = true, Length = 20, ColumnDescription = "杞﹀瀷浠g爜")] + public string Traintype_code { get; set; } + + /// <summary> + /// 杞﹀瀷鍚嶇О + /// </summary> + [ImporterHeader(Name = "杞﹀瀷鍚嶇О")] + [ExporterHeader(DisplayName = "杞﹀瀷鍚嶇О")] + [SugarColumn(IsNullable = true, Length = 20, ColumnDescription = "杞﹀瀷鍚嶇О")] + public string Traintype_name { get; set; } + + /// <summary> + /// 鎻忚堪 + /// </summary> + [ImporterHeader(Name = "鎻忚堪")] + [ExporterHeader(DisplayName = "鎻忚堪")] + [SugarColumn(IsNullable = false, Length = 100, ColumnDescription = "鎻忚堪")] + public string Traintype_des { get; set; } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/BasicInfo/dt_needBarcode.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/BasicInfo/dt_needBarcode.cs" new file mode 100644 index 0000000..1c892e5 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/BasicInfo/dt_needBarcode.cs" @@ -0,0 +1,62 @@ +锘縰sing SqlSugar; +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Text; +using WIDESEA_Core.DB.Models; +using WIDESEA_Model.Models; + +namespace WIDESEAWCS_Model.Models +{ + [SugarTable("dt_needBarcode")] + public class dt_needBarcode : BaseEntity + { + [Key] + [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "涓婚敭")] + public int id { get; set; } + + /// <summary> + /// 鐩爣搴撳尯 + /// </summary> + [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "鐩爣搴撳尯")] + public string toArea { get; set; } + + /// <summary> + /// 鏉ユ簮搴撳尯 + /// </summary> + [SugarColumn(IsNullable = false, Length = 10, ColumnDescription = "鏉ユ簮搴撳尯")] + public string fromArea { get; set; } + + /// <summary> + /// 鎵樼洏绫诲瀷 + /// </summary> + [SugarColumn(IsNullable = false, Length = 10, ColumnDescription = "鎵樼洏绫诲瀷")] + public string barcodeType { get; set; } + + /// <summary> + /// 浜х嚎 + /// </summary> + [SugarColumn(IsNullable = false, Length = 10, ColumnDescription = "鎵�灞炰骇绾�")] + public string productLine { get; set; } + + /// <summary> + /// 鍦ㄩ�旀暟閲� + /// </summary> + [SugarColumn(IsNullable = false, Length = 10, ColumnDescription = "鍦ㄩ�旀暟閲�")] + public int inLineNum { get; set; } + + /// <summary> + /// 鐩爣缂撳瓨鏁伴噺 + /// </summary> + [SugarColumn(IsNullable = false, Length = 10, ColumnDescription = "鍙紦瀛樻暟閲�")] + public int cacheNum { get; set; } = 0; + + + /// <summary> + /// 宸插垱寤哄嚭搴撲换鍔℃暟閲� + /// </summary> + //[NotMapped] + //public int haveOutNum { get; set; } = 0; + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/BasicModel/DtBoxingInfo.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/BasicModel/DtBoxingInfo.cs" new file mode 100644 index 0000000..de981c4 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/BasicModel/DtBoxingInfo.cs" @@ -0,0 +1,64 @@ +锘縰sing Masuit.Tools.Core.Validator; +using SqlSugar; +using System.ComponentModel.DataAnnotations; +using WIDESEA_Core.DB.Models; + +namespace WIDESEA_Model.Models +{ + [SugarTable(nameof(DtBoxingInfo), "缁勭洏淇℃伅")] + public class DtBoxingInfo : BaseEntity + { + /// <summary> + /// 涓婚敭 + /// </summary> + [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "涓婚敭")] + public int Id { get; set; } + + /// <summary> + /// 鎵樼洏缂栫爜 + /// </summary> + [Required] + [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "鎵樼洏缂栧彿")] + public string PalletCode { get; set; } + + /// <summary> + /// 鏄惁婊$洏 + /// </summary> + [Required] + [SugarColumn(IsNullable = true, ColumnDescription = "鏄惁婊$洏")] + public bool IsFull { get; set; } = true; + + /// <summary> + /// 澶囨敞 + /// </summary> + [SugarColumn(IsNullable = true, ColumnDescription = "澶囨敞")] + public string Remark { get; set; } + + + /// <summary> + /// 鐢熶骇浜х嚎 + /// </summary> + [SugarColumn(IsNullable = true, ColumnDescription = "鐢熶骇浜х嚎")] + public string ProductionLine { get; set; } + + /// <summary> + /// 褰撳墠宸ュ簭 + /// </summary> + [SugarColumn(IsNullable = true, ColumnDescription = "褰撳墠宸ュ簭")] + public string ProcessCode { get; set; } + + /// <summary> + /// 涓嬩竴宸ュ簭 + /// </summary> + [SugarColumn(IsNullable = true, ColumnDescription = "涓嬩竴宸ュ簭")] + public string NextProcessCode { get; set; } + + /// <summary> + /// 搴撳瓨鏄庣粏 + /// </summary> + [MinItemsCount(1)] // 妫�娴嬮泦鍚堝厓绱犳渶灏�1涓� + [SugarColumn(ColumnName = "BoxingInfoDetails")] + [Navigate(NavigateType.OneToMany, nameof(DtBoxingInfoDetail.BoxingInfoId))] + public List<DtBoxingInfoDetail>? BoxingInfoDetails { get; set; } + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/BasicModel/DtBoxingInfoDetail.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/BasicModel/DtBoxingInfoDetail.cs" new file mode 100644 index 0000000..d55b38a --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/BasicModel/DtBoxingInfoDetail.cs" @@ -0,0 +1,82 @@ +锘縰sing SqlSugar; +using System.ComponentModel.DataAnnotations; +using WIDESEA_Core.DB.Models; + +namespace WIDESEA_Model.Models; + +[SugarTable(nameof(DtBoxingInfoDetail), "缁勭洏鏄庣粏")] +public class DtBoxingInfoDetail : BaseEntity +{ + /// <summary> + /// 涓婚敭 + /// </summary> + [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "涓婚敭")] + public int Id { get; set; } + + /// <summary> + /// 缁勭洏淇℃伅涓婚敭 + /// </summary> + [SugarColumn(IsNullable = false, ColumnDescription = "缁勭洏淇℃伅涓婚敭")] + public int BoxingInfoId { get; set; } + + /// <summary> + /// 鐗╂枡缂栫爜 缁戝畾浠g爜 + /// </summary> + [Required] + [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "鐗╂枡缂栧彿")] + public string MaterielCode { get; set; } + + /// <summary> + /// 鐗╂枡鍚嶇О + /// </summary> + [Required] + [SugarColumn(IsNullable = false, Length = 200, ColumnDescription = "鐗╂枡鍚嶇О")] + public string MaterielName { get; set; } + + /// <summary> + /// 鍗曟嵁缂栧彿 / 閫氶亾 + /// </summary> + [Required] + [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "鍗曟嵁缂栧彿")] + public string OrderNo { get; set; } + + /// <summary> + /// 鎵规鍙� + /// </summary> + [Required] + [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "鎵规鍙�")] + public string BatchNo { get; set; } + + /// <summary> + /// 搴忓垪鍙�(鐢佃姱) + /// </summary> + [Required] + [SugarColumn(IsNullable = false, Length = 100, ColumnDescription = "搴忓垪鍙�")] + public string SerialNumber { get; set; } + + /// <summary> + /// 搴撳瓨鏁伴噺 + /// </summary> + [Required] + [SugarColumn(IsNullable = false, DecimalDigits = 2, ColumnDescription = "搴撳瓨鏁伴噺")] + public decimal StockQuantity { get; set; } + + /// <summary> + /// 鍑哄簱鏁伴噺 + /// </summary> + [SugarColumn(IsNullable = true, DecimalDigits = 2, ColumnDescription = "鍑哄簱鏁伴噺", DefaultValue = "0")] + public decimal OutboundQuantity { get; set; } + + /// <summary> + /// 缁勭洏鐘舵�� 鐢佃姱鐘舵�� + /// </summary> + [Required] + [SugarColumn(IsNullable = false, ColumnDescription = "缁勭洏鐘舵��")] + public int Status { get; set; } + + /// <summary> + /// 澶囨敞 // 鏂欐灞炴�son + /// </summary> + [SugarColumn(IsNullable = true, ColumnDescription = "澶囨敞")] + public string Remark { get; set; } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/BasicModel/DtLocationInfo.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/BasicModel/DtLocationInfo.cs" new file mode 100644 index 0000000..78d9300 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/BasicModel/DtLocationInfo.cs" @@ -0,0 +1,86 @@ +锘縰sing SqlSugar; +using WIDESEA_Core.DB.Models; + +namespace WIDESEA_Model.Models; + +[SugarTable(nameof(DtLocationInfo), "璐т綅淇℃伅")] +public class DtLocationInfo : BaseEntity +{ + /// <summary> + /// 涓婚敭 + /// </summary> + [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "涓婚敭")] + public int Id { get; set; } + + /// <summary> + /// 鍖哄煙涓婚敭 + /// </summary> + [SugarColumn(IsNullable = false, ColumnDescription = "鍖哄煙涓婚敭")] + public int AreaId { get; set; } + + /// <summary> + /// 璐т綅缂栧彿 + /// </summary> + [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "璐т綅缂栧彿")] + public string LocationCode { get; set; } + + /// <summary> + /// 璐т綅鍚嶇О + /// </summary> + [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "璐т綅鍚嶇О")] + public string LocationName { get; set; } + + /// <summary> + /// 宸烽亾缂栧彿 + /// </summary> + [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "宸烽亾缂栧彿")] + public string RoadwayNo { get; set; } + + /// <summary> + /// 璐т綅琛� + /// </summary> + [SugarColumn(IsNullable = false, ColumnDescription = "璐т綅琛�")] + public int Row { get; set; } + + /// <summary> + /// 璐т綅鍒� + /// </summary> + [SugarColumn(IsNullable = false, ColumnDescription = "璐т綅鍒�")] + public int Column { get; set; } + + /// <summary> + /// 璐т綅灞� + /// </summary> + [SugarColumn(IsNullable = false, ColumnDescription = "璐т綅灞�")] + public int Layer { get; set; } + + /// <summary> + /// 璐т綅娣卞害 + /// </summary> + [SugarColumn(IsNullable = false, ColumnDescription = "璐т綅娣卞害")] + public int Depth { get; set; } + + /// <summary> + /// 璐т綅绫诲瀷 锛�1-鏅�氳揣鏋跺簱浣� 2-妫�娴嬫煖搴撲綅锛� + /// </summary> + [SugarColumn(IsNullable = false, ColumnDescription = "璐т綅绫诲瀷")] + public int LocationType { get; set; } + + /// <summary> + /// 璐т綅鐘舵�� + /// </summary> + [SugarColumn(IsNullable = false, ColumnDescription = "璐т綅鐘舵��")] + public int LocationStatus { get; set; } + + /// <summary> + /// 绂佺敤鐘舵�� 锛�1-鍚敤 0-绂佺敤锛� + /// </summary> + [SugarColumn(IsNullable = false, ColumnDescription = "绂佺敤鐘舵��")] + public int EnalbeStatus { get; set; } + + /// <summary> + /// 澶囨敞 (妫�娴嬫煖鍏佽/涓嶅厑璁稿叆) + /// </summary> + [SugarColumn(IsNullable = true, Length = 200, ColumnDescription = "澶囨敞")] + public string Remark { get; set; } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/BasicModel/DtLocationStatusChangeRecord.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/BasicModel/DtLocationStatusChangeRecord.cs" new file mode 100644 index 0000000..814abf0 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/BasicModel/DtLocationStatusChangeRecord.cs" @@ -0,0 +1,74 @@ +锘縰sing SqlSugar; +using WIDESEA_Core.DB.Models; + +namespace WIDESEA_Model.Models; + +[SugarTable(nameof(DtLocationStatusChangeRecord), "璐т綅鐘舵�佸彉鍔ㄨ褰�")] +public class DtLocationStatusChangeRecord : BaseEntity +{ + /// <summary> + /// 涓婚敭 + /// </summary> + [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "涓婚敭")] + public int Id { get; set; } + + /// <summary> + /// 璐т綅涓婚敭 + /// </summary> + [SugarColumn(IsNullable = false, ColumnDescription = "璐т綅涓婚敭")] + public int LocationId { get; set; } + + /// <summary> + /// 璐т綅缂栧彿 + /// </summary> + [SugarColumn(IsNullable = true, Length = 20, ColumnDescription = "璐т綅缂栧彿")] + public string LocationCode { get; set; } + + /// <summary> + /// 鍙樺姩鍓嶈揣浣嶇姸鎬� + /// </summary> + [SugarColumn(IsNullable = false, ColumnDescription = "鍙樺姩鍓嶈揣浣嶇姸鎬�")] + public int BeforeStatus { get; set; } + + /// <summary> + /// 鍙樺姩鍚庤揣浣嶇姸鎬� + /// </summary> + [SugarColumn(IsNullable = false, ColumnDescription = "鍙樺姩鍚庤揣浣嶇姸鎬�")] + public int AfterStatus { get; set; } + + /// <summary> + /// 鍙樺姩绫诲瀷锛堝嚭搴撱�佸叆搴撱�佹墜鍔ㄨ皟鏁�...锛� + /// </summary> + [SugarColumn(IsNullable = false, ColumnDescription = "鍙樺姩绫诲瀷锛堝嚭搴撱�佸叆搴撱�佹墜鍔ㄨ皟鏁�...锛�")] + public int ChangeType { get; set; } + + /// <summary> + /// 鍗曟嵁涓婚敭 + /// </summary> + [SugarColumn(IsNullable = true, ColumnDescription = "鍗曟嵁涓婚敭")] + public int? OrderId { get; set; } + + /// <summary> + /// 鍗曟嵁缂栧彿 + /// </summary> + [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "鍗曟嵁缂栧彿")] + public string OrderNo { get; set; } + + /// <summary> + /// 鍗曟嵁鏄庣粏涓婚敭 + /// </summary> + [SugarColumn(IsNullable = true, ColumnDescription = "鍗曟嵁鏄庣粏涓婚敭")] + public int? OrderDetailId { get; set; } + + /// <summary> + /// 浠诲姟鍙� + /// </summary> + [SugarColumn(IsNullable = true, ColumnDescription = "浠诲姟鍙�")] + public int? TaskNum { get; set; } + + /// <summary> + /// 澶囨敞 + /// </summary> + [SugarColumn(IsNullable = true, ColumnDescription = "澶囨敞")] + public string Remark { get; set; } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/BasicModel/DtStockInfo.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/BasicModel/DtStockInfo.cs" new file mode 100644 index 0000000..fd68d02 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/BasicModel/DtStockInfo.cs" @@ -0,0 +1,147 @@ +锘縰sing Magicodes.ExporterAndImporter.Core; +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Core.DB.Models; + +namespace WIDESEA_Model.Models +{ + [SugarTable(nameof(DtStockInfo), "搴撳瓨淇℃伅")] + public class DtStockInfo : BaseEntity + { + /// <summary> + /// 涓婚敭 + /// </summary> + [ImporterHeader(Name = "涓婚敭")] + [ExporterHeader(DisplayName = "涓婚敭")] + [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "涓婚敭")] + public int Id { get; set; } + + /// <summary> + /// 鎵樼洏缂栧彿 + /// </summary> + [ImporterHeader(Name = "鎵樼洏缂栧彿")] + [ExporterHeader(DisplayName = "鎵樼洏缂栧彿")] + [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "鎵樼洏缂栧彿")] + public string PalletCode { get; set; } + + /// <summary> + /// 璐т綅缂栧彿 + /// </summary> + [ImporterHeader(Name = "璐т綅ID")] + [ExporterHeader(DisplayName = "璐т綅ID")] + [SugarColumn(IsNullable = true, ColumnDescription = "璐т綅ID")] + public int LocationId { get; set; } + + /// <summary> + /// 璐т綅缂栧彿 + /// </summary> + [ImporterHeader(Name = "璐т綅缂栧彿")] + [ExporterHeader(DisplayName = "璐т綅缂栧彿")] + [SugarColumn(IsNullable = true, Length = 20, ColumnDescription = "璐т綅缂栧彿")] + public string LocationCode { get; set; } + + /// <summary> + /// 鏄惁婊$洏 + /// </summary> + [ImporterHeader(Name = "鏄惁瀹炵洏")] + [ExporterHeader(DisplayName = "鏄惁瀹炵洏")] + [SugarColumn(IsNullable = false, ColumnDescription = "鏄惁婊$洏", DefaultValue = "0")] + public bool IsFull { get; set; } + + /// <summary> + /// 澶囨敞 (闈欏埗\闄堝寲鏃堕棿) + /// </summary> + [ImporterHeader(Name = "鐢佃姱鏁伴噺")] + [ExporterHeader(DisplayName = "鐢佃姱鏁伴噺")] + [SugarColumn(IsNullable = true, ColumnDescription = "鐢佃姱鏁伴噺")] + public string Remark { get; set; } + + /// <summary> + /// 鍏宠仈宸ュ簭杩斿洖鏃堕棿锛堟敞娑瞈闈欑疆鏃堕暱锛� + /// </summary> + [ImporterHeader(Name = "宸ュ簭杩斿洖鏃堕棿")] + [ExporterHeader(DisplayName = "宸ュ簭杩斿洖鏃堕棿")] + public string LinedProcessFeedbackTime { get; set; } + + /// <summary> + /// 鐗瑰緛鍙傛暟杩斿洖(闈欑疆鏃堕暱) + /// </summary> + [ImporterHeader(Name = "闈欑疆鏃堕暱")] + [ExporterHeader(DisplayName = "闈欑疆鏃堕暱")] + public string SpecialParameterDuration { get; set; } + + /// <summary> + /// 鐢熶骇浜х嚎 + /// </summary> + [ImporterHeader(Name = "鐢熶骇浜х嚎")] + [ExporterHeader(DisplayName = "鐢熶骇浜х嚎")] + [SugarColumn(IsNullable = true, ColumnDescription = "鐢熶骇浜х嚎")] + public string ProductionLine { get; set; } + + /// <summary> + /// 鍖哄煙缂栫爜 + /// </summary> + [ImporterHeader(Name = "鍖哄煙缂栫爜")] + [ExporterHeader(DisplayName = "鍖哄煙缂栫爜")] + [SugarColumn(IsNullable = true, ColumnDescription = "鍖哄煙缂栫爜")] + public string AreaCode { get; set; } + + /// <summary> + /// 搴斿嚭搴撴椂闂� + /// </summary> + [ImporterHeader(Name = "搴斿嚭搴撴椂闂�")] + [ExporterHeader(DisplayName = "搴斿嚭搴撴椂闂�")] + [SugarColumn(IsNullable = true, ColumnDescription = "搴斿嚭搴撴椂闂�")] + public DateTime? OutboundTime { get; set; } + + /// <summary> + /// 鍙傛暟淇℃伅 + /// </summary> + [ImporterHeader(Name = "鍙傛暟淇℃伅")] + [ExporterHeader(DisplayName = "鍙傛暟淇℃伅")] + [SugarColumn(IsNullable = true, ColumnDescription = "鍙傛暟淇℃伅")] + public string ParameterInfos { get; set; } + + /// <summary> + /// 搴撳瓨鐘舵�� + /// </summary> + [ImporterHeader(Name = "鍒涘缓鑰�")] + [ExporterHeader(DisplayName = "鍒涘缓鑰�")] + [SugarColumn(IsNullable = true, ColumnDescription = "搴撳瓨鐘舵��")] + public int StockStatus { get; set; } + + /// <summary> + /// 褰撳墠宸ュ簭 + /// </summary> + [ImporterHeader(Name = "褰撳墠宸ュ簭")] + [ExporterHeader(DisplayName = "褰撳墠宸ュ簭")] + [SugarColumn(IsNullable = true, ColumnDescription = "褰撳墠宸ュ簭")] + public string ProcessCode { get; set; } + + /// <summary> + /// 涓嬩竴宸ュ簭 + /// </summary> + [ImporterHeader(Name = "涓嬩竴宸ュ簭")] + [ExporterHeader(DisplayName = "涓嬩竴宸ュ簭")] + [SugarColumn(IsNullable = true, ColumnDescription = "涓嬩竴宸ュ簭")] + public string NextProcessCode { get; set; } + + /// <summary> + /// 搴撳瓨鏄庣粏 + /// </summary> + [SugarColumn(ColumnName = "StockInfoDetails")] + [Navigate(NavigateType.OneToMany, nameof(DtStockInfoDetail.StockId))] + public List<DtStockInfoDetail>? StockInfoDetails { get; set; } + + /// <summary> + /// 璐т綅鏁版嵁 + /// </summary> + [SugarColumn(ColumnName = "LocationInfo")] + [Navigate(NavigateType.OneToOne, nameof(LocationId), nameof(DtLocationInfo.Id))] + public DtLocationInfo? LocationInfo { get; set; } + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/BasicModel/DtStockInfoDetail.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/BasicModel/DtStockInfoDetail.cs" new file mode 100644 index 0000000..e4b331e --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/BasicModel/DtStockInfoDetail.cs" @@ -0,0 +1,79 @@ +锘縰sing SqlSugar; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Core.DB.Models; + +namespace WIDESEA_Model.Models; + +[SugarTable(nameof(DtStockInfoDetail), "搴撳瓨淇℃伅鏄庣粏")] +public class DtStockInfoDetail : BaseEntity +{ + /// <summary> + /// 涓婚敭 + /// </summary> + [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "涓婚敭")] + public int Id { get; set; } + + /// <summary> + /// 搴撳瓨淇℃伅涓婚敭 + /// </summary> + [SugarColumn(IsNullable = false, ColumnDescription = "搴撳瓨淇℃伅涓婚敭")] + public int StockId { get; set; } + + /// <summary> + /// 鐗╂枡缂栧彿 + /// </summary> + [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "鐗╂枡缂栧彿")] + public string MaterielCode { get; set; } + + /// <summary> + /// 鐗╂枡鍚嶇О + /// </summary> + [SugarColumn(IsNullable = false, Length = 200, ColumnDescription = "鐗╂枡鍚嶇О")] + public string MaterielName { get; set; } + + /// <summary> + /// 鍗曟嵁缂栧彿 + /// </summary> + [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "鍗曟嵁缂栧彿")] + public string OrderNo { get; set; } + + /// <summary> + /// 鎵规鍙� + /// </summary> + [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "鎵规鍙�")] + public string BatchNo { get; set; } + + /// <summary> + /// 搴忓垪鍙� + /// </summary> + [SugarColumn(IsNullable = false, Length = 100, ColumnDescription = "搴忓垪鍙�")] + public string SerialNumber { get; set; } + + /// <summary> + /// 搴撳瓨鏁伴噺 + /// </summary> + [SugarColumn(IsNullable = false, DecimalDigits = 2, ColumnDescription = "搴撳瓨鏁伴噺")] + public decimal StockQuantity { get; set; } + + /// <summary> + /// 鍑哄簱鏁伴噺 + /// </summary> + [SugarColumn(IsNullable = false, DecimalDigits = 2, ColumnDescription = "鍑哄簱鏁伴噺", DefaultValue = "0")] + public decimal OutboundQuantity { get; set; } + + /// <summary> + /// 搴撳瓨鏄庣粏鐘舵�� + /// </summary> + [SugarColumn(IsNullable = false, ColumnDescription = "搴撳瓨鏄庣粏鐘舵��")] + public int Status { get; set; } + + /// <summary> + /// 澶囨敞 + /// </summary> + [SugarColumn(IsNullable = true, ColumnDescription = "澶囨敞")] + public string Remark { get; set; } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/BasicModel/DtStockInfoDetail_Hty.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/BasicModel/DtStockInfoDetail_Hty.cs" new file mode 100644 index 0000000..7436de3 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/BasicModel/DtStockInfoDetail_Hty.cs" @@ -0,0 +1,74 @@ +锘縰sing SqlSugar; +using WIDESEA_Core.DB.Models; + +namespace WIDESEA_Model.Models; + +[SugarTable(nameof(DtStockInfoDetail_Hty), "搴撳瓨淇℃伅鏄庣粏")] +public class DtStockInfoDetail_Hty : BaseEntity +{ + /// <summary> + /// 涓婚敭 + /// </summary> + [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "涓婚敭")] + public int Id { get; set; } + + /// <summary> + /// 搴撳瓨淇℃伅涓婚敭 + /// </summary> + [SugarColumn(IsNullable = false, ColumnDescription = "搴撳瓨淇℃伅涓婚敭")] + public int StockId { get; set; } + + /// <summary> + /// 鐗╂枡缂栧彿 + /// </summary> + [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "鐗╂枡缂栧彿")] + public string MaterielCode { get; set; } + + /// <summary> + /// 鐗╂枡鍚嶇О + /// </summary> + [SugarColumn(IsNullable = false, Length = 200, ColumnDescription = "鐗╂枡鍚嶇О")] + public string MaterielName { get; set; } + + /// <summary> + /// 鍗曟嵁缂栧彿 + /// </summary> + [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "鍗曟嵁缂栧彿")] + public string OrderNo { get; set; } + + /// <summary> + /// 鎵规鍙� + /// </summary> + [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "鎵规鍙�")] + public string BatchNo { get; set; } + + /// <summary> + /// 搴忓垪鍙� + /// </summary> + [SugarColumn(IsNullable = false, Length = 100, ColumnDescription = "搴忓垪鍙�")] + public string SerialNumber { get; set; } + + /// <summary> + /// 搴撳瓨鏁伴噺 + /// </summary> + [SugarColumn(IsNullable = false, DecimalDigits = 2, ColumnDescription = "搴撳瓨鏁伴噺")] + public decimal StockQuantity { get; set; } + + /// <summary> + /// 鍑哄簱鏁伴噺 + /// </summary> + [SugarColumn(IsNullable = false, DecimalDigits = 2, ColumnDescription = "鍑哄簱鏁伴噺", DefaultValue = "0")] + public decimal OutboundQuantity { get; set; } + + /// <summary> + /// 搴撳瓨鏄庣粏鐘舵�� + /// </summary> + [SugarColumn(IsNullable = false, ColumnDescription = "搴撳瓨鏄庣粏鐘舵��")] + public int Status { get; set; } + + /// <summary> + /// 澶囨敞 + /// </summary> + [SugarColumn(IsNullable = true, ColumnDescription = "澶囨敞", Length = int.MaxValue)] + public string Remark { get; set; } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/BasicModel/DtStockInfo_Hty.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/BasicModel/DtStockInfo_Hty.cs" new file mode 100644 index 0000000..8e27fac --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/BasicModel/DtStockInfo_Hty.cs" @@ -0,0 +1,141 @@ +锘縰sing Magicodes.ExporterAndImporter.Core; +using SqlSugar; +using WIDESEA_Core.DB.Models; + +namespace WIDESEA_Model.Models +{ + [SugarTable(nameof(DtStockInfo_Hty), "搴撳瓨淇℃伅鍘嗗彶")] + public class DtStockInfo_Hty : BaseEntity + { + /// <summary> + /// 涓婚敭 + /// </summary> + [ImporterHeader(Name = "涓婚敭")] + [ExporterHeader(DisplayName = "涓婚敭")] + [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "涓婚敭")] + public int Id { get; set; } + + /// <summary> + /// 鎵樼洏缂栧彿 + /// </summary> + [ImporterHeader(Name = "鎵樼洏缂栧彿")] + [ExporterHeader(DisplayName = "鎵樼洏缂栧彿")] + [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "鎵樼洏缂栧彿")] + public string PalletCode { get; set; } + + /// <summary> + /// 璐т綅缂栧彿 + /// </summary> + [ImporterHeader(Name = "璐т綅ID")] + [ExporterHeader(DisplayName = "璐т綅ID")] + [SugarColumn(IsNullable = true, ColumnDescription = "璐т綅ID")] + public int LocationId { get; set; } + + /// <summary> + /// 璐т綅缂栧彿 + /// </summary> + [ImporterHeader(Name = "璐т綅缂栧彿")] + [ExporterHeader(DisplayName = "璐т綅缂栧彿")] + [SugarColumn(IsNullable = true, Length = 20, ColumnDescription = "璐т綅缂栧彿")] + public string LocationCode { get; set; } + + /// <summary> + /// 鏄惁婊$洏 + /// </summary> + [ImporterHeader(Name = "鏄惁瀹炵洏")] + [ExporterHeader(DisplayName = "鏄惁瀹炵洏")] + [SugarColumn(IsNullable = false, ColumnDescription = "鏄惁婊$洏", DefaultValue = "0")] + public bool IsFull { get; set; } + + /// <summary> + /// 澶囨敞 (闈欏埗\闄堝寲鏃堕棿) + /// </summary> + [ImporterHeader(Name = "鐢佃姱鏁伴噺")] + [ExporterHeader(DisplayName = "鐢佃姱鏁伴噺")] + [SugarColumn(IsNullable = true, ColumnDescription = "鐢佃姱鏁伴噺")] + public string Remark { get; set; } + + /// <summary> + /// 鍏宠仈宸ュ簭杩斿洖鏃堕棿锛堟敞娑瞈闈欑疆鏃堕暱锛� + /// </summary> + [ImporterHeader(Name = "宸ュ簭杩斿洖鏃堕棿")] + [ExporterHeader(DisplayName = "宸ュ簭杩斿洖鏃堕棿")] + public string LinedProcessFeedbackTime { get; set; } + + /// <summary> + /// 鐗瑰緛鍙傛暟杩斿洖(闈欑疆鏃堕暱) + /// </summary> + [ImporterHeader(Name = "闈欑疆鏃堕暱")] + [ExporterHeader(DisplayName = "闈欑疆鏃堕暱")] + public string SpecialParameterDuration { get; set; } + + /// <summary> + /// 鐢熶骇浜х嚎 + /// </summary> + [ImporterHeader(Name = "鐢熶骇浜х嚎")] + [ExporterHeader(DisplayName = "鐢熶骇浜х嚎")] + public string ProductionLine { get; set; } + + /// <summary> + /// 鍖哄煙缂栫爜 + /// </summary> + [ImporterHeader(Name = "鍖哄煙缂栫爜")] + [ExporterHeader(DisplayName = "鍖哄煙缂栫爜")] + [SugarColumn(IsNullable = true, ColumnDescription = "鍖哄煙缂栫爜")] + public string AreaCode { get; set; } + + /// <summary> + /// 搴斿嚭搴撴椂闂� + /// </summary> + [ImporterHeader(Name = "搴斿嚭搴撴椂闂�")] + [ExporterHeader(DisplayName = "搴斿嚭搴撴椂闂�")] + [SugarColumn(IsNullable = true, ColumnDescription = "搴斿嚭搴撴椂闂�")] + public DateTime? OutboundTime { get; set; } + + /// <summary> + /// 鍙傛暟淇℃伅 + /// </summary> + [ImporterHeader(Name = "鍙傛暟淇℃伅")] + [ExporterHeader(DisplayName = "鍙傛暟淇℃伅")] + [SugarColumn(IsNullable = true, ColumnDescription = "鍙傛暟淇℃伅", Length = int.MaxValue)] + public string ParameterInfos { get; set; } + + /// <summary> + /// 搴撳瓨鐘舵�� + /// </summary> + [ImporterHeader(Name = "鍒涘缓鑰�")] + [ExporterHeader(DisplayName = "鍒涘缓鑰�")] + [SugarColumn(IsNullable = true, ColumnDescription = "搴撳瓨鐘舵��")] + public int StockStatus { get; set; } + + /// <summary> + /// 褰撳墠宸ュ簭 + /// </summary> + [ImporterHeader(Name = "褰撳墠宸ュ簭")] + [ExporterHeader(DisplayName = "褰撳墠宸ュ簭")] + [SugarColumn(IsNullable = true, ColumnDescription = "褰撳墠宸ュ簭")] + public string ProcessCode { get; set; } + + /// <summary> + /// 涓嬩竴宸ュ簭 + /// </summary> + [ImporterHeader(Name = "涓嬩竴宸ュ簭")] + [ExporterHeader(DisplayName = "涓嬩竴宸ュ簭")] + [SugarColumn(IsNullable = true, ColumnDescription = "涓嬩竴宸ュ簭")] + public string NextProcessCode { get; set; } + + /// <summary> + /// 搴撳瓨鏄庣粏 + /// </summary> + [SugarColumn(ColumnName = "StockInfoDetails")] + [Navigate(NavigateType.OneToMany, nameof(DtStockInfoDetail_Hty.StockId))] + public List<DtStockInfoDetail_Hty>? StockInfoDetails { get; set; } + + /// <summary> + /// 璐т綅鏁版嵁 + /// </summary> + [SugarColumn(ColumnName = "LocationInfo")] + [Navigate(NavigateType.OneToOne, nameof(LocationId), nameof(DtLocationInfo.Id))] + public DtLocationInfo? LocationInfo { get; set; } + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/GZ_ZC/DistributeWheels/SelectionWheels.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/GZ_ZC/DistributeWheels/SelectionWheels.cs" new file mode 100644 index 0000000..da3140f --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/GZ_ZC/DistributeWheels/SelectionWheels.cs" @@ -0,0 +1,55 @@ +锘縰sing Magicodes.ExporterAndImporter.Core; +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Core.DB.Models; + +namespace WIDESEA_Model.Models.GZ_ZC.DistributeWheels +{ + /// <summary> + /// 棰勯�夐厤淇℃伅 + /// </summary> + public class SelectionWheels : BaseEntity + { + /// <summary> + /// 涓婚敭 + /// </summary> + [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "涓婚敭")] + public int ID { get; set; } + + /// <summary> + /// 杞﹁疆鏉$爜 + /// </summary> + [ImporterHeader(Name = "杞﹁疆鏉$爜")] + [ExporterHeader(DisplayName = "杞﹁疆鏉$爜")] + [SugarColumn(ColumnName = "CLTM", Length = 50, ColumnDescription = "杞﹁疆鏉$爜")] + public string CLTM { get; set; } + + /// <summary> + /// 杞﹁酱鏉$爜 + /// </summary> + [ImporterHeader(Name = "杞﹁酱鏉$爜")] + [ExporterHeader(DisplayName = "杞﹁酱鏉$爜")] + [SugarColumn(ColumnName = "CLTM", Length = 50, ColumnDescription = "杞﹁酱鏉$爜")] + public string CZTM { get; set; } + + /// <summary> + /// 搴撲綅鍙� + /// </summary> + [ImporterHeader(Name = "搴撲綅鍙�")] + [ExporterHeader(DisplayName = "搴撲綅鍙�")] + [SugarColumn(ColumnName = "Location", Length = 20, ColumnDescription = "搴撲綅鍙�")] + public string Location { get; set; } + + /// <summary> + /// 鏉ユ簮(1-鏂板簱 2-鏃у簱) + /// </summary> + [ImporterHeader(Name = " 鏉ユ簮")] + [ExporterHeader(DisplayName = "鏉ユ簮")] + [SugarColumn(ColumnName = "Location", Length = 20, ColumnDescription = "鏉ユ簮")] + public string WhereFrom { get; set; } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/GZ_ZC/Dt_CZInfo_mes.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/GZ_ZC/Dt_CZInfo_mes.cs" new file mode 100644 index 0000000..ac7a395 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/GZ_ZC/Dt_CZInfo_mes.cs" @@ -0,0 +1,243 @@ +锘縰sing AngleSharp.Text; +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Core.DB.Models; + +namespace WIDESEA_Model.Models +{ + [SugarTable(nameof(Dt_CZInfo_mes), "MES杞﹁酱淇℃伅")] + + public class Dt_CZInfo_mes : BaseEntity + { + /// <summary> + /// 涓婚敭 + /// </summary> + [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "涓婚敭")] + public int ID { get; set; } + + /// <summary> + /// 杞﹁酱鏉$爜 + /// </summary> + [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "杞﹁酱鏉$爜")] + public string CZTM { get; set; } + + /// <summary> + /// 缁翠慨浠诲姟 + /// </summary> + [SugarColumn(IsNullable = false, Length = 255, ColumnDescription = "缁翠慨浠诲姟")] + public string WXRW { get; set; } + + + /// <summary> + /// 杞﹁酱鍙� + /// </summary> + [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "杞﹁酱鍙�")] + public string CZH { get; set; } + + /// <summary> + /// 杞鏉$爜 + /// </summary> + [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "杞鏉$爜")] + public string LDTM { get; set; } + + /// <summary> + /// 鐘舵�� 1-鍒涘缓 2-鍏ュ簱 3-瀹屾垚 + /// </summary> + [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "鐘舵��")] + public string CurrentStatue { get; set; } + /// <summary> + /// 搴忓垪鍙� + /// </summary> + //public string Wheels_SequenceNum { get; set; } + + /// <summary> + /// 杞﹀瀷 + /// </summary> + [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "杞﹀瀷")] + public string CHEXING { get; set; } + + /// <summary> + /// 杞﹁酱鍨嬪彿 + /// </summary> + [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "杞﹁酱鍨嬪彿")] + public string CZXH { get; set; } + + /// <summary> + /// 鍔ㄦ嫋绫诲瀷 + /// </summary> + [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "鍔ㄦ嫋绫诲瀷")] + public string MTTYPE { get; set; } + + /// <summary> + /// 宸﹁疆搴х洿寰凙1 + /// </summary> + [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "宸﹁疆搴х洿寰凙1")] + public string ZLZA1 { get; set; } + + /// <summary> + /// 宸﹁疆搴х洿寰凙2 + /// </summary> + [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "宸﹁疆搴х洿寰凙2")] + public string ZLZA2 { get; set; } + + /// <宸﹁疆搴х洿寰凙3> + /// 杞鍙� + /// </summary> + [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "宸﹁疆搴х洿寰凙3")] + public string ZLZA3 { get; set; } + + /// <summary> + /// 宸﹁疆搴х洿寰凙 + /// </summary> + [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "宸﹁疆搴х洿寰凙")] + public string ZLZA { get; set; } + + /// <summary> + /// 宸﹁疆搴х洿寰凚1 + /// </summary> + [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "宸﹁疆搴х洿寰凚1")] + public string ZLZB1 { get; set; } + + /// <summary> + /// 宸﹁疆搴х洿寰凚2 + /// </summary> + [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "宸﹁疆搴х洿寰凚2")] + public string ZLZB2 { get; set; } + + /// <summary> + /// 宸﹁疆搴х洿寰凚3 + /// </summary> + [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "宸﹁疆搴х洿寰凚3")] + public string ZLZB3 { get; set; } + + /// <summary> + /// 宸﹁疆搴х洿寰凚 + /// </summary> + [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "宸﹁疆搴х洿寰凚")] + public string ZLZB { get; set; } + + /// <summary> + /// 宸﹁疆搴х洿寰凜1 + /// </summary> + [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "宸﹁疆搴х洿寰凜1")] + public string ZLZC1 { get; set; } + + /// <summary> + /// 宸﹁疆搴х洿寰凜2 + /// </summary> + [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "宸﹁疆搴х洿寰凜2")] + public string ZLZC2 { get; set; } + + /// <summary> + /// 宸﹁疆搴х洿寰凜3 + /// </summary> + [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "宸﹁疆搴х洿寰凜3")] + public string ZLZC3 { get; set; } + + /// <summary> + /// 宸﹁疆搴х洿寰凜 + /// </summary> + [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "宸﹁疆搴х洿寰凜")] + public string ZLZC { get; set; } + + /// <summary> + /// 鍙宠疆搴х洿寰凙1 + /// </summary> + [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "鍙宠疆搴х洿寰凙1")] + public string YLZA1 { get; set; } + + /// <summary> + /// 鍙宠疆搴х洿寰凙2 + /// </summary> + [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "鍙宠疆搴х洿寰凙2")] + public string YLZA2 { get; set; } + + /// <鍙宠疆搴х洿寰凙3> + /// 杞鍙� + /// </summary> + [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "鍙宠疆搴х洿寰凙3")] + public string YLZA3 { get; set; } + + /// <summary> + /// 鍙宠疆搴х洿寰凙 + /// </summary> + [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "鍙宠疆搴х洿寰凙")] + public string YLZA { get; set; } + + /// <summary> + /// 鍙宠疆搴х洿寰凚1 + /// </summary> + [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "鍙宠疆搴х洿寰凚1")] + public string YLZB1 { get; set; } + + /// <summary> + /// 鍙宠疆搴х洿寰凚2 + /// </summary> + [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "鍙宠疆搴х洿寰凚2")] + public string YLZB2 { get; set; } + + /// <summary> + /// 鍙宠疆搴х洿寰凚3 + /// </summary> + [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "鍙宠疆搴х洿寰凚3")] + public string YLZB3 { get; set; } + + /// <summary> + /// 鍙宠疆搴х洿寰凚 + /// </summary> + [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "鍙宠疆搴х洿寰凚")] + public string YLZB { get; set; } + + /// <summary> + /// 鍙宠疆搴х洿寰凜1 + /// </summary> + [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "鍙宠疆搴х洿寰凜1")] + public string YLZC1 { get; set; } + + /// <summary> + /// 鍙宠疆搴х洿寰凜2 + /// </summary> + [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "鍙宠疆搴х洿寰凜2")] + public string YLZC2 { get; set; } + + /// <summary> + /// 鍙宠疆搴х洿寰凜3 + /// </summary> + [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "鍙宠疆搴х洿寰凜3")] + public string YLZC3 { get; set; } + + /// <summary> + /// 鍙宠疆搴х洿寰凜 + /// </summary> + [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "鍙宠疆搴х洿寰凜")] + public string YLZC { get; set; } + + /// <summary> + /// 宸﹁疆搴х洿寰� + /// </summary> + [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "宸﹁疆搴х洿寰�")] + public string ZLZZJ { get; set; } + + /// <summary> + /// 鍙宠疆搴х洿寰� + /// </summary> + [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "鍙宠疆搴х洿寰�")] + public string YLZZJ { get; set; } + + /// <summary> + /// 宸﹁疆搴х瓑绾� + /// </summary> + [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "宸﹁疆搴х瓑绾�")] + public string ZLZDJ { get; set; } + + /// <summary> + /// 鍙宠疆搴х瓑绾� + /// </summary> + [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "鍙宠疆搴х瓑绾�")] + public string YLZDJ { get; set; } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/GZ_ZC/Dt_CZInfo_mes_hty.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/GZ_ZC/Dt_CZInfo_mes_hty.cs" new file mode 100644 index 0000000..b549833 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/GZ_ZC/Dt_CZInfo_mes_hty.cs" @@ -0,0 +1,28 @@ +锘縰sing AngleSharp.Text; +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Core.DB.Models; + +namespace WIDESEA_Model.Models +{ + [SugarTable(nameof(Dt_CZInfo_mes_hty), "MES杞﹁酱淇℃伅")] + + public class Dt_CZInfo_mes_hty : Dt_CZInfo_mes + { + /// <summary> + /// 瀹屾垚鏃堕棿 + /// </summary> + [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "瀹屾垚鏃堕棿")] + public DateTime? FinishDate { get; set; } = DateTime.Now; + + /// <summary> + /// 瀹屾垚鏂瑰紡 + /// </summary> + [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "瀹屾垚鏂瑰紡")] + public int OperateType { get; set; } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/GZ_ZC/Dt_CacheInfo.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/GZ_ZC/Dt_CacheInfo.cs" new file mode 100644 index 0000000..878aec4 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/GZ_ZC/Dt_CacheInfo.cs" @@ -0,0 +1,58 @@ +锘縰sing AngleSharp.Text; +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Core.DB.Models; + +namespace WIDESEA_Model.Models +{ + [SugarTable(nameof(Dt_CacheInfo), "缂撳瓨鏋朵俊鎭�")] + + public class Dt_CacheInfo : BaseEntity + { + /// <summary> + /// 涓婚敭 + /// </summary> + [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "涓婚敭")] + public int ID { get; set; } + + /// <summary> + /// 缂撳瓨鏋跺彿 + /// </summary> + [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "缂撳瓨鏋跺彿")] + public string cacheNo { get; set; } + + /// <summary> + /// 缂撳瓨鏋跺悕绉� + /// </summary> + [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "缂撳瓨鏋跺悕绉�")] + public string cacheName { get; set; } + + /// <summary> + /// 杞﹁酱鍙� + /// </summary> + [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "杞﹁酱鍙�")] + public string czh { get; set; } + + /// <summary> + /// 鎵�灞炶溅杞笅鏂欎綅 (宸︿晶-2032 鍙充晶-2042) + /// </summary> + [SugarColumn(IsNullable = true, Length = 10, ColumnDescription = "鎵�灞炶溅杞笅鏂欎綅")] + public string targetAddress { get; set; } + + /// <summary> + /// 鍒涘缓鏂瑰紡 (1-鑷姩鍒涘缓 2-鎵嬪姩鍒涘缓) + /// </summary> + [SugarColumn(IsNullable = false, Length = 10, ColumnDescription = "鍒涘缓鏂瑰紡")] + public int createType { get; set; } + + /// <summary> + /// 缂撳瓨鏋跺娉� + /// </summary> + [SugarColumn(IsNullable = false, Length = 10, ColumnDescription = "缂撳瓨鏋跺娉�")] + public string cacheDES { get; set; } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/GZ_ZC/Dt_CacheInfo_hty.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/GZ_ZC/Dt_CacheInfo_hty.cs" new file mode 100644 index 0000000..2995008 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/GZ_ZC/Dt_CacheInfo_hty.cs" @@ -0,0 +1,29 @@ +锘縰sing AngleSharp.Text; +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Core.DB.Models; +using WIDESEAWCS_Model.Models; + +namespace WIDESEA_Model.Models +{ + [SugarTable(nameof(Dt_CacheInfo_hty), "缂撳瓨鏋跺巻鍙叉暟鎹�")] + + public class Dt_CacheInfo_hty : Dt_CacheInfo + { + /// <summary> + /// 瀹屾垚鏃堕棿 + /// </summary> + [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "瀹屾垚鏃堕棿")] + public DateTime? FinishDate { get; set; } = DateTime.Now; + + /// <summary> + /// 瀹屾垚鏂瑰紡 + /// </summary> + [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "瀹屾垚鏂瑰紡")] + public int OperateType { get; set; } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/GZ_ZC/Dt_CheckResult.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/GZ_ZC/Dt_CheckResult.cs" new file mode 100644 index 0000000..c3e6359 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/GZ_ZC/Dt_CheckResult.cs" @@ -0,0 +1,184 @@ +锘縰sing AngleSharp.Text; +using Magicodes.ExporterAndImporter.Core; +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Core.DB.Models; + +namespace WIDESEA_Model.Models +{ + [SugarTable(nameof(Dt_CheckResult), "妫�娴嬬粨鏋�")] + + public class Dt_CheckResult //: BaseEntity + { + /// <summary> + /// 涓婚敭 + /// </summary> + [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "涓婚敭")] + public int ID { get; set; } + /// <summary> + /// 璁惧缂栧彿 + /// </summary> + [SugarColumn(ColumnName = "EquipNo", Length = 50, ColumnDescription = "璁惧缂栧彿")] + public string EquipNo { get; set; } + /// <summary> + /// 杞﹁疆鏉$爜 + /// </summary> + [ImporterHeader(Name = "杞﹁疆鏉$爜")] + [ExporterHeader(DisplayName = "杞﹁疆鏉$爜")] + [SugarColumn(ColumnName = "CLTM", Length = 50, ColumnDescription = "杞﹁疆鏉$爜")] + public string CLTM { get; set; } + + /// <summary> + /// 娴嬮噺绫诲瀷(杞﹁疆/鍒跺姩鐩�) + /// </summary> + [SugarColumn(ColumnName = "CheckType", Length = 50, ColumnDescription = "娴嬮噺绫诲瀷(杞﹁疆/鍒跺姩鐩�)")] + public string CheckType { get; set; } + + /// <summary> + /// 杞�/鐩樻瘋瀛旂洿寰処1 + /// </summary> + [ImporterHeader(Name = "杞�/鐩樻瘋瀛旂洿寰処1")] + [ExporterHeader(DisplayName = "杞�/鐩樻瘋瀛旂洿寰処1")] + [SugarColumn(ColumnName = "gkzjI1", Length = 50, ColumnDescription = "杞�/鐩樻瘋瀛旂洿寰処1")] + public string gkzjI1 { get; set; } + /// <summary> + /// 杞�/鐩樻瘋瀛旂洿寰処2 + /// </summary> + [ImporterHeader(Name = "杞�/鐩樻瘋瀛旂洿寰処2")] + [ExporterHeader(DisplayName = "杞�/鐩樻瘋瀛旂洿寰処2")] + [SugarColumn(ColumnName = "gkzjI2", Length = 50, ColumnDescription = "杞�/鐩樻瘋瀛旂洿寰処2")] + public string gkzjI2 { get; set; } + /// <summary> + /// 杞�/鐩樻瘋瀛旂洿寰処3 + /// </summary> + [ImporterHeader(Name = "杞�/鐩樻瘋瀛旂洿寰処3")] + [ExporterHeader(DisplayName = "杞�/鐩樻瘋瀛旂洿寰処3")] + [SugarColumn(ColumnName = "gkzjI3", Length = 50, ColumnDescription = "杞�/鐩樻瘋瀛旂洿寰処3")] + public string gkzjI3 { get; set; } + /// <summary> + /// 杞�/鐩樻瘋瀛旂洿寰処骞冲潎鍊� + /// </summary> + [ImporterHeader(Name = "杞�/鐩樻瘋瀛旂洿寰処鍧囧��")] + [ExporterHeader(DisplayName = "杞�/鐩樻瘋瀛旂洿寰処鍧囧��")] + [SugarColumn(ColumnName = "gkzjIAvg", Length = 50, ColumnDescription = "杞�/鐩樻瘋瀛旂洿寰処骞冲潎鍊�")] + public string gkzjIAvg { get; set; } + /// <summary> + /// 杞�/鐩樻瘋瀛旂洿寰処鍦嗗害 + /// </summary> + [SugarColumn(ColumnName = "gkzjICir", Length = 50, ColumnDescription = "杞�/鐩樻瘋瀛旂洿寰処鍦嗗害")] + public string gkzjICir { get; set; } + + /// <summary> + /// 杞�/鐩樻瘋瀛旂洿寰処I1 + /// </summary> + [ImporterHeader(Name = "杞�/鐩樻瘋瀛旂洿寰処I1")] + [ExporterHeader(DisplayName = "杞�/鐩樻瘋瀛旂洿寰処I1")] + [SugarColumn(ColumnName = "gkzjII1", Length = 50, ColumnDescription = "杞�/鐩樻瘋瀛旂洿寰処I1")] + public string gkzjII1 { get; set; } + /// <summary> + /// 杞�/鐩樻瘋瀛旂洿寰処I2 + /// </summary> + [ImporterHeader(Name = "杞�/鐩樻瘋瀛旂洿寰処I2")] + [ExporterHeader(DisplayName = "杞�/鐩樻瘋瀛旂洿寰処I2")] + [SugarColumn(ColumnName = "gkzjII2", Length = 50, ColumnDescription = "杞�/鐩樻瘋瀛旂洿寰処I2")] + public string gkzjII2 { get; set; } + /// <summary> + /// 杞�/鐩樻瘋瀛旂洿寰処I3 + /// </summary> + [ImporterHeader(Name = "杞�/鐩樻瘋瀛旂洿寰処I3")] + [ExporterHeader(DisplayName = "杞�/鐩樻瘋瀛旂洿寰処I3")] + [SugarColumn(ColumnName = "gkzjII3", Length = 50, ColumnDescription = "杞�/鐩樻瘋瀛旂洿寰処I3")] + public string gkzjII3 { get; set; } + /// <summary> + /// 杞�/鐩樻瘋瀛旂洿寰処I骞冲潎鍊� + /// </summary> + [ImporterHeader(Name = "杞�/鐩樻瘋瀛旂洿寰処I骞冲潎鍊�")] + [ExporterHeader(DisplayName = "杞�/鐩樻瘋瀛旂洿寰処I骞冲潎鍊�")] + [SugarColumn(ColumnName = "gkzjIIAvg", Length = 50, ColumnDescription = "杞�/鐩樻瘋瀛旂洿寰処I骞冲潎鍊�")] + public string gkzjIIAvg { get; set; } + /// <summary> + /// 杞�/鐩樻瘋瀛旂洿寰処I鍦嗗害 + /// </summary> + [SugarColumn(ColumnName = "gkzjIICir", Length = 50, ColumnDescription = "杞�/鐩樻瘋瀛旂洿寰処I鍦嗗害")] + public string gkzjIICir { get; set; } + + //CRH1銆丆RH2A(缁�)銆丆RH380A(L) + //CRH6A杞﹀瀷鍒跺姩鐩樻祴閲忎笁涓埅闈紝鍏朵綑鎶�鏈崗璁腑闄愬畾杞﹀瀷鍒跺姩鐩樻祴閲忎袱涓埅闈€�傛墍鏈夎溅杞疆姣傚瓟閮芥祴閲忎笁涓埅闈� + + /// <summary> + /// 杞�/鐩樻瘋瀛旂洿寰処II1 鍙┖ + /// </summary> + [ImporterHeader(Name = "杞�/鐩樻瘋瀛旂洿寰処II1")] + [ExporterHeader(DisplayName = "杞�/鐩樻瘋瀛旂洿寰処II1")] + [SugarColumn(ColumnName = "gkzjIII1", Length = 50, ColumnDescription = "杞�/鐩樻瘋瀛旂洿寰処II1")] + public string gkzjIII1 { get; set; } + /// <summary> + /// 杞�/鐩樻瘋瀛旂洿寰処II2 鍙┖ + /// </summary> + [ImporterHeader(Name = "杞�/鐩樻瘋瀛旂洿寰処II2")] + [ExporterHeader(DisplayName = "杞�/鐩樻瘋瀛旂洿寰処II2")] + [SugarColumn(ColumnName = "gkzjIII2", Length = 50, ColumnDescription = "杞�/鐩樻瘋瀛旂洿寰処II2")] + public string gkzjIII2 { get; set; } + /// <summary> + /// 杞�/鐩樻瘋瀛旂洿寰処II3 鍙┖ + /// </summary> + [ImporterHeader(Name = "杞�/鐩樻瘋瀛旂洿寰処II3")] + [ExporterHeader(DisplayName = "杞�/鐩樻瘋瀛旂洿寰処II3")] + [SugarColumn(ColumnName = "gkzjIII3", Length = 50, ColumnDescription = "杞� / 鐩樻瘋瀛旂洿寰処II3")] + public string gkzjIII3 { get; set; } + /// <summary> + /// 杞�/鐩樻瘋瀛旂洿寰処II骞冲潎鍊� 鍙┖ + /// </summary> + [ImporterHeader(Name = "杞�/鐩樻瘋瀛旂洿寰処II骞冲潎鍊�")] + [ExporterHeader(DisplayName = "杞�/鐩樻瘋瀛旂洿寰処II骞冲潎鍊�")] + [SugarColumn(ColumnName = "gkzjIIIAvg", Length = 50, ColumnDescription = "杞�/鐩樻瘋瀛旂洿寰処II骞冲潎鍊�")] + public string gkzjIIIAvg { get; set; } + /// <summary> + /// 杞�/鐩樻瘋瀛旂洿寰処II鍦嗗害 鍙┖ + /// </summary> + [SugarColumn(ColumnName = "gkzjIIICir", Length = 50, ColumnDescription = "杞�/鐩樻瘋瀛旂洿寰処II鍦嗗害")] + public string gkzjIIICir { get; set; } + + /// <summary> + /// 杞�/鐩樻瘋瀛旂洿寰勫钩鍧囧�� + /// </summary> + [ImporterHeader(Name = "杞�/鐩樻瘋瀛旂洿寰勫钩鍧囧��")] + [ExporterHeader(DisplayName = "杞�/鐩樻瘋瀛旂洿寰勫钩鍧囧��")] + [SugarColumn(ColumnName = "gkzjAVG", Length = 50, ColumnDescription = "杞�/鐩樻瘋瀛旂洿寰勫钩鍧囧��")] + public string gkzjAVG { get; set; } + + /// <summary> + /// 杞�/鐩樻瘋瀛旂洿寰勫渾鏌卞害 + /// </summary> + [SugarColumn(ColumnName = "gkzjCir", Length = 50, ColumnDescription = "杞�/鐩樻瘋瀛旂洿寰勫渾鏌卞害")] + public string gkzjCir { get; set; } + + /// <summary> + /// 鏄惁鍚堟牸 1-鍚堟牸 2-涓嶅悎鏍� + /// </summary> + [ImporterHeader(Name = "鏄惁鍚堟牸")] + [ExporterHeader(DisplayName = "鏄惁鍚堟牸")] + [SugarColumn(ColumnName = "Result", Length = 50, ColumnDescription = "鏄惁鍚堟牸")] + public int Result { get; set; } + + /// <summary> + /// 涓婁紶鏃堕棿 + /// </summary> + [ImporterHeader(Name = "涓婁紶鏃堕棿")] + [ExporterHeader(DisplayName = "涓婁紶鏃堕棿")] + [SugarColumn(ColumnName = "InDate", Length = 50, ColumnDescription = "涓婁紶鏃堕棿")] + public DateTime? InDate { get; set; } + + /// <summary> + /// 鏄惁宸蹭笂浼燴Y绯荤粺 + /// </summary> + [ImporterHeader(Name = "鏄惁宸蹭笂浼犳櫤绮ょ郴缁�")] + [ExporterHeader(DisplayName = "鏄惁宸蹭笂浼犳櫤绮ょ郴缁�")] + [SugarColumn(ColumnName = "IsUploadMES", Length = 50, ColumnDescription = "鏄惁宸蹭笂浼犳櫤绮ょ郴缁�")] + public bool IsUploadMES { get; set; } //= false; + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/GZ_ZC/Dt_InWheels_mes.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/GZ_ZC/Dt_InWheels_mes.cs" new file mode 100644 index 0000000..435d472 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/GZ_ZC/Dt_InWheels_mes.cs" @@ -0,0 +1,156 @@ +锘縰sing AngleSharp.Text; +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Core.DB.Models; + +namespace WIDESEA_Model.Models +{ + [SugarTable(nameof(Dt_InWheels_mes), "MES杞﹁疆淇℃伅")] + + public class Dt_InWheels_mes : BaseEntity + { + /// <summary> + /// 涓婚敭 + /// </summary> + [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "涓婚敭")] + public int Wheels_ID { get; set; } + + /// <summary> + /// 杞﹁疆鍙� + /// </summary> + [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "杞﹁疆鏉$爜")] + public string Wheels_code { get; set; } + + /// <summary> + /// 绫诲埆 (杞﹁疆/ 鍒跺姩鐩�) + /// </summary> + [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "绫诲埆(杞﹁疆/鍒跺姩鐩�)")] + public string Wheels_Type { get; set; } + + /// <summary> + /// 鐘舵�� 1-鍒涘缓 2-鍏ュ簱 3-瀹屾垚 4-鍒犻櫎 + /// </summary> + [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "鐘舵��")] + public string Wheels_CurrentStatue { get; set; } + /// <summary> + /// 搴忓垪鍙� + /// </summary> + //public string Wheels_SequenceNum { get; set; } + + /// <summary> + /// 杞﹁疆鏉$爜 + /// </summary> + [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "杞﹁疆鏉$爜")] + public string Wheels_Num { get; set; } + + /// <summary> + /// 杞鏉$爜 + /// </summary> + [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "杞鏉$爜")] + public string Wheels_ldtm { get; set; } + + /// <summary> + /// 杞﹀瀷 + /// </summary> + [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "杞﹀瀷")] + public string Wheels_CarType { get; set; } + + /// <summary> + /// 閰嶅睘灞� + /// </summary> + [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "閰嶅睘灞�")] + public string Wheels_psj { get; set; } + + /// <summary> + /// 杞︾粍鍙� + /// </summary> + [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "杞︾粍鍙�")] + public string Wheels_CarNo { get; set; } + + /// <summary> + /// 杞鍙� + /// </summary> + [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "杞鍙�")] + public string Wheels_ldh { get; set; } + + /// <summary> + /// 杞鍨嬪彿 + /// </summary> + [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "杞鍨嬪彿")] + public string Wheels_ldxh { get; set; } + + /// <summary> + /// 鍔ㄦ嫋灞炴�锛氬姩,T锛氭嫋 M/T锛氬姩鎷栭�氱敤 + /// </summary> + [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "鍔ㄦ嫋灞炴��")] + public string Wheels_mttype { get; set; } + + /// <summary> + /// 鏂版棫灞炴�� 1锛氭棫 0 锛氭柊 + /// </summary> + [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "鏂版棫绫诲瀷")] + public string Wheels_NewOrOld { get; set; } + + /// <summary> + /// 灞炴�� + /// </summary> + [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "杞﹁疆灞炴��")] + public string WheelsProps { get; set; } + + /// <summary> + /// 绛夌骇 + /// </summary> + [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "绛夌骇")] + public string Wheels_level { get; set; } + + /// <summary> + /// 姣傚瓟a鐣岄潰鍧囧�� + /// </summary> + [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "姣傚瓟a鐣岄潰鍧囧��")] + public string Wheels_gkzja { get; set; } + /// <summary> + /// 姣傚瓟b鐣岄潰鍧囧�� + /// </summary> + [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "姣傚瓟b鐣岄潰鍧囧��")] + public string Wheels_gkzjb { get; set; } + /// <summary> + /// 姣傚瓟c鐣岄潰鍧囧�� + /// </summary> + [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "姣傚瓟c鐣岄潰鍧囧��")] + public string Wheels_gkzjc { get; set; } + + /// <summary> + /// 姣傚瓟鍧囧�� + /// </summary> + [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "姣傚瓟鍧囧��")] + public string Wheels_gkcc { get; set; } + + /// <summary> + /// 杞緞鍊� + /// </summary> + [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "杞緞鍊�")] + public string Wheels_ljz { get; set; } + + /// <summary> + /// 棰勪及杞緞鍊� + /// </summary> + [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "棰勪及杞緞鍊�")] + public string Wheels_ygljz { get; set; } + + /// <summary> + /// 鍏ュ簱鏃ユ湡 + /// </summary> + [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "鍏ュ簱鏃ユ湡")] + public string Wheels_InDate { get; set; } + + /// <summary> + /// 杞紭 + /// </summary> + [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "杞紭")] + public string Wheels_LYH { get; set; } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/GZ_ZC/Dt_InWheels_mes_hty.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/GZ_ZC/Dt_InWheels_mes_hty.cs" new file mode 100644 index 0000000..c62157e --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/GZ_ZC/Dt_InWheels_mes_hty.cs" @@ -0,0 +1,27 @@ +锘縰sing SqlSugar; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Core.DB.Models; + +namespace WIDESEA_Model.Models +{ + [SugarTable(nameof(Dt_InWheels_mes_hty), "MES杞﹁疆鍘嗗彶淇℃伅")] + + public class Dt_InWheels_mes_hty : Dt_InWheels_mes + { + /// <summary> + /// 瀹屾垚鏃堕棿 + /// </summary> + [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "瀹屾垚鏃堕棿")] + public DateTime? FinishDate { get; set; } = DateTime.Now; + + /// <summary> + /// 瀹屾垚鏂瑰紡 + /// </summary> + [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "瀹屾垚鏂瑰紡")] + public int OperateType { get; set; } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/GZ_ZC/Dt_SelectionStandards.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/GZ_ZC/Dt_SelectionStandards.cs" new file mode 100644 index 0000000..5a4d22f --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/GZ_ZC/Dt_SelectionStandards.cs" @@ -0,0 +1,64 @@ +锘縰sing AngleSharp.Text; +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Core.DB.Models; + +namespace WIDESEA_Model.Models +{ + [SugarTable(nameof(Dt_SelectionStandards), "閫夐厤鏍囧噯")] + + public class Dt_SelectionStandards : BaseEntity + { + /// <summary> + /// 涓婚敭 + /// </summary> + [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "涓婚敭")] + public int ID { get; set; } + + /// <summary> + /// 閫傜敤杞﹀瀷 澶氫釜鐢�,闅斿紑 + /// </summary> + [SugarColumn(IsNullable = false, Length = 30, ColumnDescription = "閫傜敤杞﹀瀷")] + public string CarType { get; set; } + + /// <summary> + /// 鍔ㄦ嫋灞炴�� + /// </summary> + [SugarColumn(IsNullable = false, Length = 10, ColumnDescription = "鍔ㄦ嫋灞炴��")] + public string mttype { get; set; } + + /// <summary> + /// 鏂版棫灞炴�� + /// </summary> + [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "鏂版棫灞炴��")] + public string neworold { get; set; } + + /// <summary> + /// 姣傚瓟绛夌骇 + /// </summary> + [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "姣傚瓟绛夌骇")] + public string gkdj { get; set; } + + [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "杩囩泩閲忎笅闄�")] + public decimal lowerValue { get; set; } + + [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "杩囩泩閲忎笂闄�")] + public decimal upperValue { get; set; } + + /// <summary> + /// 鏄惁鍖呭惈姣傚瓟鍧囧�� + /// </summary> + [SugarColumn(IsNullable = true, ColumnDescription = "姣傚瓟杩囩泩閲忎笅闄�")] + public bool isCantainGK { get; set; } + + [SugarColumn(IsNullable = true, Length = 20, ColumnDescription = "姣傚瓟杩囩泩閲忎笅闄�")] + public decimal lowerValue_gk { get; set; } + + [SugarColumn(IsNullable = true, Length = 20, ColumnDescription = "姣傚瓟杩囩泩閲忎笂闄�")] + public decimal upperValue_gk { get; set; } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/GZ_ZC/Dt_WheelsStock.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/GZ_ZC/Dt_WheelsStock.cs" new file mode 100644 index 0000000..190adec --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/GZ_ZC/Dt_WheelsStock.cs" @@ -0,0 +1,216 @@ +锘縰sing Magicodes.ExporterAndImporter.Core; +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Core.DB.Models; + +namespace WIDESEA_Model.Models +{ + [SugarTable(nameof(Dt_WheelsStock), "搴撳瓨淇℃伅")] + + public class Dt_WheelsStock : BaseEntity + { + /// <summary> + /// 涓婚敭 + /// </summary> + [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "涓婚敭")] + public int Wheels_ID { get; set; } + + + /// <summary> + /// 搴忓垪鍙� + /// </summary> + //public string Wheels_SequenceNum { get; set; } + + /// <summary> + /// 杞﹁疆鍙� + /// </summary> + [ImporterHeader(Name = "鏉$爜")] + [ExporterHeader(DisplayName = "鏉$爜")] + [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "鏉$爜")] + public string Wheels_code { get; set; } + + + /// <summary> + /// 绫诲埆 (杞﹁疆/ 鍒跺姩鐩�) 1-杞� 2-鐩� + /// </summary> + [ImporterHeader(Name = "绫诲埆(杞﹁疆/鍒跺姩鐩�)")] + [ExporterHeader(DisplayName = "绫诲埆(杞﹁疆/鍒跺姩鐩�)")] + [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = " 绫诲埆(杞﹁疆/鍒跺姩鐩�)")] + public string Wheels_Type { get; set; } + + /// <summary> + /// 鐘舵�� 0-鍒涘缓 1-鍦ㄥ簱 2-宸查�夐厤 3-棰勯�夐厤 4-鎸囧畾鍑哄簱 + /// </summary> + [ImporterHeader(Name = "鐘舵��")] + [ExporterHeader(DisplayName = "鐘舵��")] + [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "鐘舵��")] + public int? Wheels_CurrentStatue { get; set; } = 0; + + /// <summary> + /// 搴撲綅鍙� + /// </summary> + [ImporterHeader(Name = "搴撲綅鍙�")] + [ExporterHeader(DisplayName = "搴撲綅鍙�")] + [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "搴撲綅鍙�")] + public string Wheels_Location { get; set; } + + /// <summary> + /// 杞﹁疆鏉$爜 + /// </summary> + [ImporterHeader(Name = "杞﹁疆鏉$爜")] + [ExporterHeader(DisplayName = "杞﹁疆鏉$爜")] + [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "杞﹁疆鏉$爜")] + public string Wheels_Num { get; set; } + + /// <summary> + /// 杞鏉$爜 + /// </summary> + [ImporterHeader(Name = "杞鏉$爜")] + [ExporterHeader(DisplayName = "杞鏉$爜")] + [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "杞鏉$爜")] + public string Wheels_ldtm { get; set; } + + /// <summary> + /// 杞﹀瀷 + /// </summary> + [ImporterHeader(Name = "杞﹀瀷")] + [ExporterHeader(DisplayName = "杞﹀瀷")] + [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "杞﹀瀷")] + public string Wheels_CarType { get; set; } + + /// <summary> + /// 閰嶅睘灞� + /// </summary> + [ImporterHeader(Name = "閰嶅睘灞�")] + [ExporterHeader(DisplayName = "閰嶅睘灞�")] + [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "閰嶅睘灞�")] + public string Wheels_psj { get; set; } + + /// <summary> + /// 杞︾粍鍙� + /// </summary> + [ImporterHeader(Name = "杞︾粍鍙�")] + [ExporterHeader(DisplayName = "杞︾粍鍙�")] + [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "杞︾粍鍙�")] + public string Wheels_CarNo { get; set; } + + /// <summary> + /// 杞鍙� + /// </summary> + [ImporterHeader(Name = "杞鍙�")] + [ExporterHeader(DisplayName = "杞鍙�")] + [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "杞鍙�")] + public string Wheels_ldh { get; set; } + + /// <summary> + /// 杞瀷 + /// </summary> + [ImporterHeader(Name = "杞瀷")] + [ExporterHeader(DisplayName = "杞瀷")] + [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "杞瀷")] + public string Wheels_ldxh { get; set; } + + /// <summary> + /// 鍔ㄦ嫋灞炴�锛氬姩,T锛氭嫋 M/T锛氬姩鎷栭�氱敤 + /// </summary> + [ImporterHeader(Name = "鍔ㄦ嫋灞炴��")] + [ExporterHeader(DisplayName = "鍔ㄦ嫋灞炴��")] + [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "鍔ㄦ嫋灞炴��")] + public string Wheels_mttype { get; set; } + + /// <summary> + /// 鏂版棫灞炴�� 1锛氭棫 0 锛氭柊 + /// </summary> + [ImporterHeader(Name = "鏂版棫绫诲瀷")] + [ExporterHeader(DisplayName = "鏂版棫绫诲瀷")] + [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "鏂版棫绫诲瀷")] + public string Wheels_NewOrOld { get; set; } + + /// <summary> + /// 灞炴�� + /// </summary> + [ImporterHeader(Name = "杞﹁疆灞炴��")] + [ExporterHeader(DisplayName = "杞﹁疆灞炴��")] + [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "杞﹁疆灞炴��")] + public string WheelsProps { get; set; } + + /// <summary> + /// 绛夌骇 + /// </summary> + [ImporterHeader(Name = "绛夌骇")] + [ExporterHeader(DisplayName = "绛夌骇")] + [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "绛夌骇")] + public string Wheels_level { get; set; } + + /// <summary> + /// 姣傚瓟a鐣岄潰鍧囧�� + /// </summary> + + [ImporterHeader(Name = "姣傚瓟a鐣岄潰鍧囧��")] + [ExporterHeader(DisplayName = "姣傚瓟a鐣岄潰鍧囧��")] + [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "姣傚瓟a鐣岄潰鍧囧��")] + public string Wheels_gkzja { get; set; } + /// <summary> + /// 姣傚瓟b鐣岄潰鍧囧�� + /// </summary> + [ImporterHeader(Name = "姣傚瓟b鐣岄潰鍧囧��")] + [ExporterHeader(DisplayName = "姣傚瓟b鐣岄潰鍧囧��")] + [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "姣傚瓟b鐣岄潰鍧囧��")] + public string Wheels_gkzjb { get; set; } + /// <summary> + /// 姣傚瓟c鐣岄潰鍧囧�� + /// </summary> + [ImporterHeader(Name = "姣傚瓟c鐣岄潰鍧囧��")] + [ExporterHeader(DisplayName = "姣傚瓟c鐣岄潰鍧囧��")] + + [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "姣傚瓟c鐣岄潰鍧囧��")] + public string Wheels_gkzjc { get; set; } + + /// <summary> + /// 姣傚瓟鍧囧�� + /// </summary> + + [ImporterHeader(Name = "姣傚瓟鍧囧��")] + [ExporterHeader(DisplayName = "姣傚瓟鍧囧��")] + [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "姣傚瓟鍧囧��")] + public string Wheels_gkcc { get; set; } + + /// <summary> + /// 杞緞鍊� + /// </summary> + [ImporterHeader(Name = "杞緞鍊�")] + [ExporterHeader(DisplayName = "杞緞鍊�")] + [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "杞緞鍊�")] + public string Wheels_ljz { get; set; } + + /// <summary> + /// 棰勪及杞緞鍊� + /// </summary> + + [ImporterHeader(Name = "棰勪及杞緞鍊�")] + [ExporterHeader(DisplayName = "棰勪及杞緞鍊�")] + [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "棰勪及杞緞鍊�")] + public string Wheels_ygljz { get; set; } + + /// <summary> + /// 鍏ュ簱鏃ユ湡 + /// </summary> + [ImporterHeader(Name = "鍏ュ簱鏃ユ湡")] + [ExporterHeader(DisplayName = "鍏ュ簱鏃ユ湡")] + [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "鍏ュ簱鏃ユ湡")] + public string Wheels_InDate { get; set; } + + /// <summary> + /// 杞紭 + /// </summary> + [ImporterHeader(Name = "杞紭")] + [ExporterHeader(DisplayName = "杞紭")] + [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "杞紭")] + public string Wheels_LYH { get; set; } + + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/GZ_ZC/Dt_WheelsStock_hty.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/GZ_ZC/Dt_WheelsStock_hty.cs" new file mode 100644 index 0000000..a2cf61d --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/GZ_ZC/Dt_WheelsStock_hty.cs" @@ -0,0 +1,27 @@ +锘縰sing SqlSugar; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Core.DB.Models; + +namespace WIDESEA_Model.Models +{ + [SugarTable(nameof(Dt_WheelsStock_hty), "搴撳瓨鍘嗗彶淇℃伅")] + + public class Dt_WheelsStock_hty : Dt_WheelsStock + { + /// <summary> + /// 瀹屾垚鏃堕棿 + /// </summary> + [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "瀹屾垚鏃堕棿")] + public DateTime? FinishWheelDate { get; set; } = DateTime.Now; + + /// <summary> + /// 瀹屾垚鏂瑰紡 + /// </summary> + [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "瀹屾垚鏂瑰紡")] + public int OperateType { get; set; } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/GZ_ZC/OldWheelsStock/Dt_WheelsStock_Old.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/GZ_ZC/OldWheelsStock/Dt_WheelsStock_Old.cs" new file mode 100644 index 0000000..b9a9299 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/GZ_ZC/OldWheelsStock/Dt_WheelsStock_Old.cs" @@ -0,0 +1,240 @@ +锘縰sing Magicodes.ExporterAndImporter.Core; +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Core.DB.Models; + +namespace WIDESEA_Model.Models +{ + [SugarTable(nameof(Dt_WheelsStock_Old), "鏃у簱搴撳瓨淇℃伅")] + + public class Dt_WheelsStock_Old + { + /// <summary> + /// 涓婚敭 + /// </summary> + //[SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "涓婚敭")] + //public int Wheels_ID { get; set; } + + /// <summary> + /// 杞﹁疆缂栧彿 + /// </summary> + [ImporterHeader(Name = "杞﹁疆缂栧彿")] + [ExporterHeader(DisplayName = "杞﹁疆缂栧彿")] + [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "杞﹁疆缂栧彿")] + public string wheel_code { get; set; } + + + /// <summary> + /// 杞鍙� + /// </summary> + [ImporterHeader(Name = "杞鍙�")] + [ExporterHeader(DisplayName = "杞鍙�")] + [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "杞鍙�")] + public string feedbackno { get; set; } + + /// <summary> + /// 杞︾粍鍙� + /// </summary> + [ImporterHeader(Name = "杞︾粍鍙�")] + [ExporterHeader(DisplayName = "杞︾粍鍙�")] + [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "杞︾粍鍙�")] + public string axes_code { get; set; } + + /// <summary> + /// 鏂�/鏃� + /// </summary> + [ImporterHeader(Name = "鏂�/鏃�")] + [ExporterHeader(DisplayName = "鏂�/鏃�")] + [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "鏂�/鏃�")] + public string repair_item { get; set; } + + /// <summary> + /// 杞﹁疆绫诲埆(M/T) + /// </summary> + [ImporterHeader(Name = "杞﹁疆绫诲埆(M/T)")] + [ExporterHeader(DisplayName = "杞﹁疆绫诲埆(M/T)")] + [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "杞﹁疆绫诲埆(M/T)")] + public string dqtz_state { get; set; } + + /// <summary> + /// 杞﹁疆鍨嬪彿 + /// </summary> + [ImporterHeader(Name = "杞﹁疆鍨嬪彿")] + [ExporterHeader(DisplayName = "杞﹁疆鍨嬪彿")] + [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "杞﹁疆鍨嬪彿")] + public string axes_type { get; set; } + + /// <summary> + /// 姣傚瓟绛夌骇 + /// </summary> + [ImporterHeader(Name = "姣傚瓟绛夌骇")] + [ExporterHeader(DisplayName = "姣傚瓟绛夌骇")] + [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "姣傚瓟绛夌骇")] + public string venderno { get; set; } + + /// <summary> + /// 杞�/鐩樼被鍨� + /// </summary> + [ImporterHeader(Name = "杞�/鐩樼被鍨�")] + [ExporterHeader(DisplayName = "杞�/鐩樼被鍨�")] + [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "杞�/鐩樼被鍨�")] + public string bearing_type { get; set; } + + /// <summary> + /// 鍒跺姩鐩樻潗璐� + /// </summary> + [ImporterHeader(Name = "鍒跺姩鐩樻潗璐�")] + [ExporterHeader(DisplayName = "鍒跺姩鐩樻潗璐�")] + [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "鍒跺姩鐩樻潗璐�")] + public string matertextrue { get; set; } + + /// <summary> + /// 杞﹀瀷 + /// </summary> + [ImporterHeader(Name = "杞﹀瀷")] + [ExporterHeader(DisplayName = "杞﹀瀷")] + [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "杞﹀瀷")] + public string model { get; set; } + + /// <summary> + /// 鍒堕�犲巶 + /// </summary> + [ImporterHeader(Name = "鍒堕�犲巶")] + [ExporterHeader(DisplayName = "鍒堕�犲巶")] + [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "鍒堕�犲巶")] + public string wheel_from { get; set; } + + /// <summary> + /// 閰嶅睘灞� + /// </summary> + [ImporterHeader(Name = "閰嶅睘灞�")] + [ExporterHeader(DisplayName = "閰嶅睘灞�")] + [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "閰嶅睘灞�")] + public string wheel_pan { get; set; } + + /// <summary> + /// 杞瘋瀛旂洿寰� + /// </summary> + [ImporterHeader(Name = "杞瘋瀛旂洿寰�")] + [ExporterHeader(DisplayName = "杞瘋瀛旂洿寰�")] + [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "杞瘋瀛旂洿寰�")] + public string zjj { get; set; } + + /// <summary> + /// 棰勪及闀熶慨鍚庤疆寰勫�� + /// </summary> + [ImporterHeader(Name = "棰勪及闀熶慨鍚庤疆寰勫��")] + [ExporterHeader(DisplayName = "棰勪及闀熶慨鍚庤疆寰勫��")] + [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "棰勪及闀熶慨鍚庤疆寰勫��")] + public string zszj { get; set; } + + /// <summary> + /// 杞紭鍘� + /// </summary> + [ImporterHeader(Name = "杞紭鍘�")] + [ExporterHeader(DisplayName = "杞紭鍘�")] + [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "杞紭鍘�")] + public string zcd { get; set; } + + /// <summary> + /// 杞磋/杞鍒跺姩鐩樺墿浣欑(鑰� + /// </summary> + [ImporterHeader(Name = "杞磋/杞鍒跺姩鐩樺墿浣欑(鑰�")] + [ExporterHeader(DisplayName = "杞磋/杞鍒跺姩鐩樺墿浣欑(鑰�")] + [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "杞磋/杞鍒跺姩鐩樺墿浣欑(鑰�")] + public string m_zdpzzj { get; set; } + /// <summary> + /// 澶囨敞 + /// </summary> + [ImporterHeader(Name = "澶囨敞")] + [ExporterHeader(DisplayName = "澶囨敞")] + [SugarColumn(IsNullable = false, Length = 100, ColumnDescription = "澶囨敞")] + public string remarks { get; set; } + /// <summary> + /// 淇濆吇鍛ㄦ湡鎻愰啋 + /// </summary> + [ImporterHeader(Name = "淇濆吇鍛ㄦ湡鎻愰啋")] + [ExporterHeader(DisplayName = "淇濆吇鍛ㄦ湡鎻愰啋")] + + [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "淇濆吇鍛ㄦ湡鎻愰啋")] + public string mqtz_state { get; set; } + + /// <summary> + /// 涓婃淇濆吇鏃堕棿 + /// </summary> + [ImporterHeader(Name = "涓婃淇濆吇鏃堕棿")] + [ExporterHeader(DisplayName = "涓婃淇濆吇鏃堕棿")] + [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "涓婃淇濆吇鏃堕棿")] + public string dt_bearing_dx { get; set; } + + /// <summary> + /// 涓嬫淇濆吇鏃堕棿 + /// </summary> + [ImporterHeader(Name = "涓嬫淇濆吇鏃堕棿")] + [ExporterHeader(DisplayName = "涓嬫淇濆吇鏃堕棿")] + [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "涓嬫淇濆吇鏃堕棿")] + public string dt_rtn { get; set; } + + /// <summary> + /// 棰勪及杞緞鍊� + /// </summary> + + [ImporterHeader(Name = "棰勪及杞緞鍊�")] + [ExporterHeader(DisplayName = "棰勪及杞緞鍊�")] + [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "棰勪及杞緞鍊�")] + public string Wheels_ygljz { get; set; } + + /// <summary> + /// 鍏ュ簱鏃ユ湡 + /// </summary> + [ImporterHeader(Name = "鍏ュ簱鏃ユ湡")] + [ExporterHeader(DisplayName = "鍏ュ簱鏃ユ湡")] + [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "鍏ュ簱鏃ユ湡")] + public string dt_ins { get; set; } + + /// <summary> + /// 浜ゆ鏃ユ湡 + /// </summary> + [ImporterHeader(Name = "浜ゆ鏃ユ湡")] + [ExporterHeader(DisplayName = "浜ゆ鏃ユ湡")] + [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "浜ゆ鏃ユ湡")] + public string dt_detect { get; set; } + + /// <summary> + /// 浜ゆ浜� + /// </summary> + [ImporterHeader(Name = "浜ゆ浜�")] + [ExporterHeader(DisplayName = "浜ゆ浜�")] + [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "浜ゆ浜�")] + public string wheel_type { get; set; } + + /// <summary> + /// 鍏ュ簱浜� + /// </summary> + [ImporterHeader(Name = "鍏ュ簱浜�")] + [ExporterHeader(DisplayName = "鍏ュ簱浜�")] + [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "鍏ュ簱浜�")] + public string dept_code { get; set; } + + /// <summary> + /// 澶囩敤鐘舵��1 + /// </summary> + [ImporterHeader(Name = "澶囩敤鐘舵��1")] + [ExporterHeader(DisplayName = "澶囩敤鐘舵��1")] + [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "澶囩敤鐘舵��1")] + public string spare_state1 { get; set; } + + /// <summary> + /// 璐т綅鍙� + /// </summary> + [ImporterHeader(Name = "璐т綅鍙�")] + [ExporterHeader(DisplayName = "璐т綅鍙�")] + [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "璐т綅鍙�")] + public string Locate { get; set; } + + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/OutboundOrder/Dt_OutOrder.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/OutboundOrder/Dt_OutOrder.cs" new file mode 100644 index 0000000..2372345 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/OutboundOrder/Dt_OutOrder.cs" @@ -0,0 +1,67 @@ +锘縰sing SqlSugar; +using WIDESEA_Core.DB.Models; + +namespace WIDESEA_Model.Models; + +/// <summary> +/// 绯荤粺鍑哄簱璁㈠崟澶磋〃 +///</summary> +[SugarTable("Dt_OutOrder", "绯荤粺鍑哄簱璁㈠崟澶磋〃")] +public class Dt_OutOrder : BaseEntity +{ + /// <summary> + /// 澶� 娉�:涓婚敭锛岃嚜鍔ㄥ闀� + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "Id", IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "涓婚敭锛岃嚜鍔ㄥ闀�")] + public int Id { get; set; } + + /// <summary> + /// 澶� 娉�:鍑哄簱鍗曞彿 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "OrderNumber", ColumnDescription = "鍑哄簱鍗曞彿", IsNullable = false, Length = 30)] + public string OrderNumber { get; set; } = null!; + + /// <summary> + /// 澶� 娉�: 鍑哄簱鏃ユ湡 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "OrderDate", ColumnDescription = "鍑哄簱鏃ユ湡", IsNullable = false)] + public DateTime OrderDate { get; set; } + + /// <summary> + /// 澶� 娉�:浠撳簱ID + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "WarehouseId", ColumnDescription = "浠撳簱ID", IsNullable = true)] + public int WarehouseId { get; set; } + + /// <summary> + /// 澶� 娉�:鍗曟嵁鐘舵�� + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "Status", ColumnDescription = "鍗曟嵁鐘舵��", IsNullable = false)] + public int Status { get; set; } + + /// <summary> + /// 澶� 娉�:涓婃湁绯荤粺鍗曟嵁ID + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "UpperOutOrderId", ColumnDescription = "涓婃湁绯荤粺鍗曟嵁ID", IsNullable = false)] + public int? UpperOutOrderId { get; set; } + + /// <summary> + /// 澶� 娉�: 澶囨敞 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "Remarks", ColumnDescription = "澶囨敞", IsNullable = false, Length = 100)] + public string? Remarks { get; set; } + + /// <summary> + /// 璁㈠崟鏄庣粏鏁版嵁 + /// </summary> + [SugarColumn(IsIgnore = true)] + [Navigate(NavigateType.OneToOne, nameof(Id), nameof(Dt_OutOrderDetail.OutOrderId))] + public Dt_OutOrderDetail? OrderDetailList { get; set; } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/OutboundOrder/Dt_OutOrderAndStock.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/OutboundOrder/Dt_OutOrderAndStock.cs" new file mode 100644 index 0000000..8ce1155 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/OutboundOrder/Dt_OutOrderAndStock.cs" @@ -0,0 +1,130 @@ +锘縰sing SqlSugar; +using WIDESEA_Core.DB.Models; + +namespace WIDESEA_Model.Models; + +/// <summary> +/// 鍑哄簱璁㈠崟搴撳瓨鏁版嵁鏄庣粏琛� +///</summary> +[SugarTable("Dt_OutOrderAndStock", "鍑哄簱璁㈠崟搴撳瓨鏁版嵁鏄庣粏琛�")] +public class Dt_OutOrderAndStock : BaseEntity +{ + /// <summary> + /// 澶� 娉�:涓婚敭ID + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "Id", IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "涓婚敭ID")] + public int Id { get; set; } + + /// <summary> + /// 澶� 娉�:鍑哄簱璁㈠崟澶碔D锛堝閿級 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "OutOrderId", ColumnDescription = "鍑哄簱璁㈠崟澶碔D锛堝閿級", IsNullable = false)] + public int OutOrderId { get; set; } + + /// <summary> + /// 澶� 娉�:搴撳瓨澶碔D锛堝閿級 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "GroupId", ColumnDescription = "搴撳瓨澶碔D锛堝閿級", IsNullable = false)] + public int GroupId { get; set; } + + /// <summary> + /// 澶� 娉�:璐т綅缂栧彿锛堝閿級 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "LocationCode", ColumnDescription = "璐т綅缂栧彿锛堝閿級", IsNullable = false)] + public string LocationCode { get; set; } = null!; + + /// <summary> + /// 澶� 娉�:璁㈠崟缂栧彿 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "OrderNumber", ColumnDescription = "璁㈠崟缂栧彿", IsNullable = false)] + public string OrderNumber { get; set; } = null!; + + /// <summary> + /// 澶� 娉�:鎵规鍙� + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "BatchNumber", ColumnDescription = "鎵规鍙�", IsNullable = false)] + public string BatchNumber { get; set; } = null!; + + /// <summary> + /// 澶� 娉�:鍑哄簱鏁伴噺 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "OutboundQuantity", ColumnDescription = "鍑哄簱鏁伴噺", IsNullable = false)] + public decimal OutboundQuantity { get; set; } + + /// <summary> + /// 澶� 娉�:鍒嗛厤鏁伴噺 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "AllocatedQuantity", ColumnDescription = "鍒嗛厤鏁伴噺", IsNullable = false)] + public decimal AllocatedQuantity { get; set; } + + /// <summary> + /// 澶� 娉�:瀹屾垚鏁伴噺 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "CompletedQuantity", ColumnDescription = "瀹屾垚鏁伴噺", IsNullable = false)] + public decimal CompletedQuantity { get; set; } + + /// <summary> + /// 澶� 娉�:鎵樼洏鍙� + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "PalletCode", ColumnDescription = "鎵樼洏鍙�", IsNullable = false)] + public string PalletCode { get; set; } = null!; + + /// <summary> + /// 澶� 娉�:鐗╂枡缂栧彿 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "MaterialNo", ColumnDescription = "鐗╂枡缂栧彿", IsNullable = false)] + public string MaterialNo { get; set; } = null!; + + /// <summary> + /// 澶� 娉�:鐗╂枡鍚嶇О + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "MaterialName", ColumnDescription = "鐗╂枡鍚嶇О", IsNullable = false)] + public string MaterialName { get; set; } = null!; + + /// <summary> + /// 澶� 娉�:搴撳瓨鐘舵�� + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "State", ColumnDescription = "搴撳瓨鐘舵��", IsNullable = false)] + public int? State { get; set; } + + /// <summary> + /// 澶� 娉�:搴撳瓨鏁伴噺 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "palletQuantity", ColumnDescription = "搴撳瓨鏁伴噺", IsNullable = false)] + public decimal? PalletQuantity { get; set; } + + ///// <summary> + ///// 璐т綅鏄庣粏鏁版嵁 + ///// </summary> + //[SugarColumn(IsIgnore = true)] + //[Navigate(NavigateType.OneToOne, nameof(LocationCode), nameof(Dt_LocationInfo.LocationID))] + //public Dt_LocationInfo? LocationList { get; set; } + + ///// <summary> + ///// 搴撳瓨澶存槑缁嗘暟鎹� + ///// </summary> + //[SugarColumn(IsIgnore = true)] + //[Navigate(NavigateType.OneToOne, nameof(GroupId), nameof(Dt_BillGroupStock.GroupId))] + //public Dt_BillGroupStock? StockList { get; set; } + + /// <summary> + /// 璁㈠崟澶存槑缁嗘暟鎹� + /// </summary> + [SugarColumn(IsIgnore = true)] + [Navigate(NavigateType.OneToOne, nameof(OutOrderId), nameof(Dt_OutOrder.Id))] + public Dt_OutOrder? OrderList { get; set; } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/OutboundOrder/Dt_OutOrderAndStock_Hty.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/OutboundOrder/Dt_OutOrderAndStock_Hty.cs" new file mode 100644 index 0000000..94e054c --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/OutboundOrder/Dt_OutOrderAndStock_Hty.cs" @@ -0,0 +1,145 @@ +锘縰sing SqlSugar; +using WIDESEA_Core.DB.Models; + +namespace WIDESEA_Model.Models +{ + /// <summary> + /// 鍑哄簱璁㈠崟搴撳瓨鏁版嵁鏄庣粏琛� + ///</summary> + [SugarTable("Dt_OutOrderAndStock_Hty", "鍑哄簱璁㈠崟搴撳瓨鏁版嵁鏄庣粏琛�")] + public class Dt_OutOrderAndStock_Hty : BaseEntity + { + /// <summary> + /// 澶� 娉�:涓婚敭ID + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "Id", IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "涓婚敭ID")] + public int Id { get; set; } + + /// <summary> + /// 澶� 娉�:鍑哄簱璁㈠崟澶碔D锛堝閿級 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "OutOrderId", ColumnDescription = "鍑哄簱璁㈠崟澶碔D锛堝閿級", IsNullable = false)] + public int OutOrderId { get; set; } + + /// <summary> + /// 澶� 娉�:搴撳瓨澶碔D锛堝閿級 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "GroupId", ColumnDescription = "搴撳瓨澶碔D锛堝閿級", IsNullable = false)] + public int GroupId { get; set; } + + /// <summary> + /// 澶� 娉�:璐т綅缂栧彿锛堝閿級 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "LocationCode", ColumnDescription = "璐т綅缂栧彿锛堝閿級", IsNullable = false)] + public string LocationCode { get; set; } = null!; + + /// <summary> + /// 澶� 娉�:璁㈠崟缂栧彿 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "OrderNumber", ColumnDescription = "璁㈠崟缂栧彿", IsNullable = false)] + public string OrderNumber { get; set; } = null!; + + /// <summary> + /// 澶� 娉�:鎵规鍙� + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "BatchNumber", ColumnDescription = "鎵规鍙�", IsNullable = false)] + public string BatchNumber { get; set; } = null!; + + /// <summary> + /// 澶� 娉�:鍑哄簱鏁伴噺 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "OutboundQuantity", ColumnDescription = "鍑哄簱鏁伴噺", IsNullable = false)] + public decimal OutboundQuantity { get; set; } + + /// <summary> + /// 澶� 娉�:鍒嗛厤鏁伴噺 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "AllocatedQuantity", ColumnDescription = "鍒嗛厤鏁伴噺", IsNullable = false)] + public decimal AllocatedQuantity { get; set; } + + /// <summary> + /// 澶� 娉�:瀹屾垚鏁伴噺 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "CompletedQuantity", ColumnDescription = "瀹屾垚鏁伴噺", IsNullable = false)] + public decimal CompletedQuantity { get; set; } + + /// <summary> + /// 澶� 娉�:鎵樼洏鍙� + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "PalletCode", ColumnDescription = "鎵樼洏鍙�", IsNullable = false)] + public string PalletCode { get; set; } = null!; + + /// <summary> + /// 澶� 娉�:鐗╂枡缂栧彿 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "MaterialNo", ColumnDescription = "鐗╂枡缂栧彿", IsNullable = false)] + public string MaterialNo { get; set; } = null!; + + /// <summary> + /// 澶� 娉�:鐗╂枡鍚嶇О + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "MaterialName", ColumnDescription = "鐗╂枡鍚嶇О", IsNullable = false)] + public string MaterialName { get; set; } = null!; + + /// <summary> + /// 澶� 娉�:搴撳瓨鐘舵�� + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "State", ColumnDescription = "搴撳瓨鐘舵��", IsNullable = false)] + public int State { get; set; } + + /// <summary> + /// 澶� 娉�:搴撳瓨鏁伴噺 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "palletQuantity", ColumnDescription = "搴撳瓨鏁伴噺", IsNullable = false)] + public decimal PalletQuantity { get; set; } + + /// <summary> + /// 澶� 娉�:瀹屾垚鏃堕棿 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "FinishTime", ColumnDescription = "瀹屾垚鏃堕棿", IsNullable = false)] + public DateTime FinishTime { get; set; } + + /// <summary> + /// 澶� 娉�: 鎿嶄綔绫诲瀷 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "OperateType", ColumnDescription = "鎿嶄綔绫诲瀷", IsNullable = false)] + public int OperateType { get; set; } + + /// <summary> + /// 澶� 娉�: 婧愬崟ID + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "SourceId", ColumnDescription = "婧愬崟ID", IsNullable = false)] + public int SourceId { get; set; } + + ///// <summary> + ///// 搴撳瓨澶存槑缁嗘暟鎹� + ///// </summary> + //[SugarColumn(IsIgnore = true)] + //[Navigate(NavigateType.OneToOne, nameof(GroupId), nameof(Dt_BillGroupStock_Hty.GroupId))] + //public Dt_BillGroupStock_Hty? StockList { get; set; } + + /// <summary> + /// 璁㈠崟澶存槑缁嗘暟鎹� + /// </summary> + [SugarColumn(IsIgnore = true)] + [Navigate(NavigateType.OneToOne, nameof(OutOrderId), nameof(Dt_OutOrder_Hty.Id))] + public Dt_OutOrder_Hty? OrderList { get; set; } + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/OutboundOrder/Dt_OutOrderDetail.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/OutboundOrder/Dt_OutOrderDetail.cs" new file mode 100644 index 0000000..cbd3c6e --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/OutboundOrder/Dt_OutOrderDetail.cs" @@ -0,0 +1,109 @@ +锘縰sing SqlSugar; +using WIDESEA_Core.DB.Models; + +namespace WIDESEA_Model.Models; + +/// <summary> +/// 绯荤粺鍑哄簱璁㈠崟鏄庣粏 +///</summary> +[SugarTable("Dt_OutOrderDetail", "绯荤粺鍑哄簱璁㈠崟鏄庣粏")] +public class Dt_OutOrderDetail : BaseEntity +{ + /// <summary> + /// 澶� 娉�: 涓婚敭锛岃嚜鍔ㄥ闀� + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "Id", IsPrimaryKey = true, IsIdentity = true, ColumnDescription = " 涓婚敭锛岃嚜鍔ㄥ闀�")] + public int Id { get; set; } + + /// <summary> + /// 澶� 娉�:鍑哄簱鍗旾D锛堝閿級 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "OutOrderId", ColumnDescription = "鍑哄簱鍗旾D锛堝閿級", IsNullable = false)] + public int OutOrderId { get; set; } + + /// <summary> + /// 澶� 娉�:鐗╂枡ID + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "MaterialId", ColumnDescription = "鐗╂枡ID", IsNullable = false)] + public int MaterialId { get; set; } + + /// <summary> + /// 澶� 娉�: 鐗╂枡鍚嶇О + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "MaterialName", ColumnDescription = " 鐗╂枡鍚嶇О", IsNullable = false, Length = 30)] + public string MaterialName { get; set; } = null!; + + /// <summary> + /// 澶� 娉�:鎵规鍙� + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "BatchNumber", ColumnDescription = "鎵规鍙�", IsNullable = false, Length = 30)] + public string BatchNumber { get; set; } = null!; + + /// <summary> + /// 澶� 娉�:鍑哄簱鏁伴噺 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "OutboundQuantity", ColumnDescription = "鍑哄簱鏁伴噺", IsNullable = false)] + public decimal OutboundQuantity { get; set; } + + /// <summary> + /// 澶� 娉�:鍒嗛厤鏁伴噺 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "AllocatedQuantity", ColumnDescription = "鍒嗛厤鏁伴噺", IsNullable = false)] + public decimal AllocatedQuantity { get; set; } + + /// <summary> + /// 澶� 娉�:瀹屾垚鏁伴噺 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "CompletedQuantity", ColumnDescription = "瀹屾垚鏁伴噺", IsNullable = false)] + public decimal CompletedQuantity { get; set; } + + /// <summary> + /// 澶� 娉�:澶囨敞 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "Remarks", ColumnDescription = "澶囨敞", IsNullable = true, Length = 100)] + public string? Remarks { get; set; } + + /// <summary> + /// 澶� 娉�:澶囩敤瀛楁1 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "SpareField1", ColumnDescription = "澶囩敤瀛楁1", IsNullable = true, Length = 30)] + public string? SpareField1 { get; set; } + + /// <summary> + /// 澶� 娉�:澶囩敤瀛楁2 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "SpareField2", ColumnDescription = "澶囩敤瀛楁2", IsNullable = true, Length = 30)] + public string? SpareField2 { get; set; } + + /// <summary> + /// 澶� 娉�:澶囩敤瀛楁3 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "SpareField3", ColumnDescription = "澶囩敤瀛楁3", IsNullable = true, Length = 30)] + public string? SpareField3 { get; set; } + + /// <summary> + /// 澶� 娉�:澶囩敤瀛楁4 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "SpareField4", ColumnDescription = "澶囩敤瀛楁4", IsNullable = true, Length = 30)] + public string? SpareField4 { get; set; } + + /// <summary> + /// 澶� 娉�:澶囩敤瀛楁5 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "SpareField5", ColumnDescription = "澶囩敤瀛楁5", IsNullable = true, Length = 30)] + public string? SpareField5 { get; set; } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/OutboundOrder/Dt_OutOrderDetail_Hty.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/OutboundOrder/Dt_OutOrderDetail_Hty.cs" new file mode 100644 index 0000000..ec5f54e --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/OutboundOrder/Dt_OutOrderDetail_Hty.cs" @@ -0,0 +1,130 @@ +锘縰sing SqlSugar; +using WIDESEA_Core.DB.Models; + +namespace WIDESEA_Model.Models; + +/// <summary> +/// 绯荤粺鍑哄簱璁㈠崟鏄庣粏鍘嗗彶 +///</summary> +[SugarTable("Dt_OutOrderDetail_Hty", "绯荤粺鍑哄簱璁㈠崟鏄庣粏鍘嗗彶")] +public class Dt_OutOrderDetail_Hty : BaseEntity +{ + /// <summary> + /// 澶� 娉�: 涓婚敭锛岃嚜鍔ㄥ闀� + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "Id", IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "涓婚敭锛岃嚜鍔ㄥ闀�")] + public int Id { get; set; } + + /// <summary> + /// 澶� 娉�: 鍑哄簱鍗旾D锛堝閿級 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "OutOrderId", ColumnDescription = "鍑哄簱鍗旾D锛堝閿級", IsNullable = false)] + public int OutOrderId { get; set; } + + /// <summary> + /// 澶� 娉�: 鐗╂枡ID + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "MaterialId", ColumnDescription = "鐗╂枡ID", IsNullable = false)] + public int MaterialId { get; set; } + + /// <summary> + /// 澶� 娉�: 鐗╂枡鍚嶇О + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "MaterialName", ColumnDescription = "鐗╂枡鍚嶇О", IsNullable = false, Length = 50)] + public string MaterialName { get; set; } = null!; + + /// <summary> + /// 澶� 娉�:鎵规鍙� + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "BatchNumber", ColumnDescription = "鎵规鍙�", IsNullable = false, Length = 30)] + public string BatchNumber { get; set; } = null!; + + /// <summary> + /// 澶� 娉�: 鍑哄簱鏁伴噺 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "OutboundQuantity", ColumnDescription = "鍑哄簱鏁伴噺", IsNullable = false)] + public decimal OutboundQuantity { get; set; } + + /// <summary> + /// 澶� 娉�: 鍒嗛厤鏁伴噺 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "AllocatedQuantity", ColumnDescription = "鍒嗛厤鏁伴噺", IsNullable = false)] + public decimal AllocatedQuantity { get; set; } + + /// <summary> + /// 澶� 娉�: 瀹屾垚鏁伴噺 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "CompletedQuantity", ColumnDescription = "瀹屾垚鏁伴噺", IsNullable = false)] + public decimal CompletedQuantity { get; set; } + + /// <summary> + /// 澶� 娉�: 澶囨敞 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "Remarks", ColumnDescription = "澶囨敞", IsNullable = false, Length = 100)] + public string? Remarks { get; set; } + + /// <summary> + /// 澶� 娉�: 澶囩敤瀛楁1 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "SpareField1", ColumnDescription = "澶囩敤瀛楁1", IsNullable = true, Length = 50)] + public string? SpareField1 { get; set; } + + /// <summary> + /// 澶� 娉�: 澶囩敤瀛楁2 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "SpareField2", ColumnDescription = "澶囩敤瀛楁2", IsNullable = true, Length = 50)] + public string? SpareField2 { get; set; } + + /// <summary> + /// 澶� 娉�: 澶囩敤瀛楁3 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "SpareField3", ColumnDescription = "澶囩敤瀛楁3", IsNullable = true, Length = 50)] + public string? SpareField3 { get; set; } + + /// <summary> + /// 澶� 娉�: 澶囩敤瀛楁4 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "SpareField4", ColumnDescription = "澶囩敤瀛楁4", IsNullable = true, Length = 50)] + public string? SpareField4 { get; set; } + + /// <summary> + /// 澶� 娉�: 澶囩敤瀛楁5 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "SpareField5", ColumnDescription = "澶囩敤瀛楁5", IsNullable = true,Length =50)] + public string? SpareField5 { get; set; } + + /// <summary> + /// 澶� 娉�:瀹屾垚鏃堕棿 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "FinishTime", ColumnDescription = "瀹屾垚鏃堕棿", IsNullable = false)] + public DateTime FinishTime { get; set; } + + /// <summary> + /// 澶� 娉�: 鎿嶄綔绫诲瀷 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "OperateType", ColumnDescription = "鎿嶄綔绫诲瀷")] + public int OperateType { get; set; } + + /// <summary> + /// 澶� 娉�: 婧愬崟ID + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "SourceId", ColumnDescription = "婧愬崟ID")] + public int SourceId { get; set; } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/OutboundOrder/Dt_OutOrderProduction.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/OutboundOrder/Dt_OutOrderProduction.cs" new file mode 100644 index 0000000..3bf2fb0 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/OutboundOrder/Dt_OutOrderProduction.cs" @@ -0,0 +1,53 @@ +锘縰sing SqlSugar; +using WIDESEA_Core.DB.Models; + +namespace WIDESEA_Model.Models; + +/// <summary> +/// 鐢熶骇鍑哄簱鍗曞ご琛� +///</summary> +[SugarTable("Dt_OutOrderProduction", "鐢熶骇鍑哄簱鍗曞ご琛�")] +public class Dt_OutOrderProduction : BaseEntity +{ + /// <summary> + /// 澶� 娉�:涓婚敭锛岃嚜鍔ㄥ闀� + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "Id", IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "涓婚敭锛岃嚜鍔ㄥ闀�")] + public int Id { get; set; } + + /// <summary> + /// 澶� 娉�:鍗曟嵁缂栧彿 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "OrderNumber", ColumnDescription = "鍗曟嵁缂栧彿", Length = 30)] + public string OrderNumber { get; set; } = null!; + + /// <summary> + /// 澶� 娉�:鍗曟嵁鏃ユ湡 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "OrderDate", ColumnDescription = "鍗曟嵁鏃ユ湡")] + public DateTime OrderDate { get; set; } + + /// <summary> + /// 澶� 娉�:浠撳簱ID + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "WarehouseId", ColumnDescription = "浠撳簱ID")] + public int WarehouseId { get; set; } + + /// <summary> + /// 澶� 娉�:鍗曟嵁鐘舵�� + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "Status", ColumnDescription = "鍗曟嵁鐘舵��")] + public int Status { get; set; } + + /// <summary> + /// 澶� 娉�:澶囨敞 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "Remarks", ColumnDescription = "澶囨敞", Length = 100, IsNullable = true)] + public string? Remarks { get; set; } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/OutboundOrder/Dt_OutOrderProductionDetail.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/OutboundOrder/Dt_OutOrderProductionDetail.cs" new file mode 100644 index 0000000..04a2916 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/OutboundOrder/Dt_OutOrderProductionDetail.cs" @@ -0,0 +1,53 @@ +锘縰sing SqlSugar; +using WIDESEA_Core.DB.Models; + +namespace WIDESEA_Model.Models; + +/// <summary> +/// 鐢熶骇鍑哄簱鍗曟槑缁� +///</summary> +[SugarTable("Dt_OutOrderProductionDetail", "鐢熶骇鍑哄簱鍗曟槑缁�")] +public class Dt_OutOrderProductionDetail : BaseEntity +{ + /// <summary> + /// 澶� 娉�:涓婚敭锛岃嚜鍔ㄥ闀� + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "Id", IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "涓婚敭锛岃嚜鍔ㄥ闀�")] + public int Id { get; set; } + + /// <summary> + /// 澶� 娉�:鐢熶骇鍑哄簱鍗旾D锛堝閿級 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "ProductionOutOrderId", ColumnDescription = "鐢熶骇鍑哄簱鍗旾D锛堝閿級")] + public int ProductionOutOrderId { get; set; } + + /// <summary> + /// 澶� 娉�:鐗╂枡ID + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "MaterialId", ColumnDescription = "鐗╂枡ID")] + public int MaterialId { get; set; } + + /// <summary> + /// 澶� 娉�: 鏁伴噺 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "Quantity", ColumnDescription = " 鏁伴噺")] + public decimal Quantity { get; set; } + + /// <summary> + /// 澶� 娉�:澶囨敞 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "Remarks", ColumnDescription = "澶囨敞", Length = 100)] + public string? Remarks { get; set; } + + /// <summary> + /// 澶� 娉�:鎵规鍙� + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "BatchNumber", ColumnDescription = "鎵规鍙�", Length = 30)] + public string BatchNumber { get; set; } = null!; +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/OutboundOrder/Dt_OutOrderProductionDetail_Hty.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/OutboundOrder/Dt_OutOrderProductionDetail_Hty.cs" new file mode 100644 index 0000000..37894bb --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/OutboundOrder/Dt_OutOrderProductionDetail_Hty.cs" @@ -0,0 +1,75 @@ +锘縰sing SqlSugar; +using WIDESEA_Core.DB.Models; + +namespace WIDESEA_Model.Models +{ + /// <summary> + /// 鐢熶骇鍑哄簱鍗曟槑缁嗗巻鍙� + ///</summary> + [SugarTable("Dt_OutOrderProductionDetail_Hty", "鐢熶骇鍑哄簱鍗曟槑缁嗗巻鍙�")] + public class Dt_OutOrderProductionDetail_Hty : BaseEntity + { + /// <summary> + /// 澶� 娉�: 涓婚敭锛岃嚜鍔ㄥ闀� + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "Id", IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "涓婚敭锛岃嚜鍔ㄥ闀�")] + public int Id { get; set; } + + /// <summary> + /// 澶� 娉�: 鐢熶骇鍑哄簱鍗旾D锛堝閿� + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "ProductionOutOrderId", ColumnDescription = "鐢熶骇鍑哄簱鍗旾D锛堝閿�")] + public int ProductionOutOrderId { get; set; } + + /// <summary> + /// 澶� 娉�: 鐗╂枡ID + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "MaterialId", ColumnDescription = "鐗╂枡ID")] + public int MaterialId { get; set; } + + /// <summary> + /// 澶� 娉�: 鏁伴噺 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "Quantity", ColumnDescription = "鏁伴噺")] + public decimal Quantity { get; set; } + + /// <summary> + /// 澶� 娉�: 澶囨敞 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "Remarks", ColumnDescription = "澶囨敞", Length = 100, IsNullable = true)] + public string? Remarks { get; set; } + + /// <summary> + /// 澶� 娉�:鎵规鍙� + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "BatchNumber", ColumnDescription = "鎵规鍙�", Length = 30)] + public string BatchNumber { get; set; } = null!; + + /// <summary> + /// 澶� 娉�: 瀹屾垚鏃堕棿 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "FinishTime", ColumnDescription = "瀹屾垚鏃堕棿")] + public DateTime FinishTime { get; set; } + + /// <summary> + /// 澶� 娉�:鎿嶄綔绫诲瀷 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "OperateType", ColumnDescription = "鎿嶄綔绫诲瀷")] + public int OperateType { get; set; } + + /// <summary> + /// 澶� 娉�:婧愬崟ID + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "SourceId", ColumnDescription = "婧愬崟ID")] + public int SourceId { get; set; } + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/OutboundOrder/Dt_OutOrderProduction_Hty.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/OutboundOrder/Dt_OutOrderProduction_Hty.cs" new file mode 100644 index 0000000..1f8056f --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/OutboundOrder/Dt_OutOrderProduction_Hty.cs" @@ -0,0 +1,74 @@ +锘縰sing SqlSugar; +using WIDESEA_Core.DB.Models; + +namespace WIDESEA_Model.Models; + +/// <summary> +/// 鐢熶骇鍑哄簱鍗曞ご琛ㄥ巻鍙� +///</summary> +[SugarTable("Dt_OutOrderProduction_Hty", "鐢熶骇鍑哄簱鍗曞ご琛ㄥ巻鍙�")] +public class Dt_OutOrderProduction_Hty : BaseEntity +{ + /// <summary> + /// 澶� 娉�:涓婚敭锛岃嚜鍔ㄥ闀� + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "Id", IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "涓婚敭锛岃嚜鍔ㄥ闀�")] + public int Id { get; set; } + + /// <summary> + /// 澶� 娉�: 鍗曟嵁缂栧彿 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "OrderNumber", ColumnDescription = "鍗曟嵁缂栧彿", Length = 30)] + public string OrderNumber { get; set; } = null!; + + /// <summary> + /// 澶� 娉�: 鍗曟嵁鏃ユ湡 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "OrderDate", ColumnDescription = "鍗曟嵁鏃ユ湡")] + public DateTime OrderDate { get; set; } + + /// <summary> + /// 澶� 娉�: 浠撳簱ID + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "WarehouseId", ColumnDescription = "浠撳簱ID")] + public int WarehouseId { get; set; } + + /// <summary> + /// 澶� 娉�: 鍗曟嵁鐘舵�� + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "Status", ColumnDescription = "鍗曟嵁鐘舵��")] + public int Status { get; set; } + + /// <summary> + /// 澶� 娉�: 澶囨敞 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "Remarks", ColumnDescription = "澶囨敞", Length = 100)] + public string? Remarks { get; set; } + + /// <summary> + /// 澶� 娉�:瀹屾垚鏃堕棿 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "FinishTime", ColumnDescription = "瀹屾垚鏃堕棿")] + public DateTime FinishTime { get; set; } + + /// <summary> + /// 澶� 娉�:鎿嶄綔绫诲瀷 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "OperateType", ColumnDescription = "鎿嶄綔绫诲瀷")] + public int OperateType { get; set; } + + /// <summary> + /// 澶� 娉�:婧愬崟ID + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "SourceId", ColumnDescription = "婧愬崟ID")] + public int SourceId { get; set; } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/OutboundOrder/Dt_OutOrderSorting.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/OutboundOrder/Dt_OutOrderSorting.cs" new file mode 100644 index 0000000..47cac28 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/OutboundOrder/Dt_OutOrderSorting.cs" @@ -0,0 +1,149 @@ +锘縰sing SqlSugar; +using WIDESEA_Core.DB.Models; + +namespace WIDESEA_Model.Models; + +/// <summary> +/// 鍑哄簱鍒嗘嫞琛� +/// </summary> +[SugarTable("Dt_OutOrderSorting", "鍑哄簱鍒嗘嫞琛�")] +public class Dt_OutOrderSorting : BaseEntity +{ + /// <summary> + /// 鍒嗘嫞鍗曞彿锛屽敮涓�鏍囪瘑鍒嗘嫞浠诲姟銆� + /// </summary> + [SugarColumn(ColumnName = "SortingID", IsPrimaryKey = true, Length = 50, IsNullable = false, IsIdentity = true, ColumnDescription = "鍒嗘嫞鍗曞彿锛屽敮涓�鏍囪瘑鍒嗘嫞浠诲姟銆�")] + public int SortingID { get; set; } + + /// <summary> + /// 璁㈠崟鍙凤紝鍏宠仈鍑哄簱璁㈠崟缂栧彿銆� + /// </summary> + [SugarColumn(ColumnName = "OrderID", Length = 50, IsNullable = false, ColumnDescription = "璁㈠崟鍙凤紝鍏宠仈鍑哄簱璁㈠崟缂栧彿銆�")] + public string OrderCode { get; set; } + + /// <summary> + /// 瀹㈡埛鍚嶇О銆� + /// </summary> + [SugarColumn(ColumnName = "CustomerName", Length = 100, IsNullable = true, ColumnDescription = "瀹㈡埛鍚嶇О銆�")] + public string? CustomerName { get; set; } + + /// <summary> + /// 鍒嗘嫞鏃ユ湡锛屽垎鎷d换鍔$殑鎵ц鏃ユ湡銆� + /// </summary> + [SugarColumn(ColumnName = "SortingDate", IsNullable = true, ColumnDescription = "鍒嗘嫞鏃ユ湡锛屽垎鎷d换鍔$殑鎵ц鏃ユ湡銆�")] + public DateTime? SortingDate { get; set; } + + /// <summary> + /// 鍒嗘嫞鍛橈紝鎵ц鍒嗘嫞浠诲姟鐨勫憳宸ュ悕绉版垨缂栧彿銆� + /// </summary> + [SugarColumn(ColumnName = "Picker", Length = 50, IsNullable = true, ColumnDescription = "鍒嗘嫞鍛橈紝鎵ц鍒嗘嫞浠诲姟鐨勫憳宸ュ悕绉版垨缂栧彿銆�")] + public string? Picker { get; set; } + + /// <summary> + /// 鍒嗘嫞鐘舵�侊紝鍒嗘嫞浠诲姟鐨勭姸鎬侊紙濡傦細鏈紑濮嬨�佽繘琛屼腑銆佸凡瀹屾垚銆佸凡鍙栨秷锛夈�� + /// </summary> + [SugarColumn(ColumnName = "SortingStatus", Length = 50, IsNullable = true, ColumnDescription = "鍒嗘嫞鐘舵�侊紝鍒嗘嫞浠诲姟鐨勭姸鎬侊紙濡傦細鏈紑濮嬨�佽繘琛屼腑銆佸凡瀹屾垚銆佸凡鍙栨秷锛夈��")] + public string? SortingStatus { get; set; } + + /// <summary> + /// 浜у搧缂栫爜锛屼骇鍝佺殑鍞竴鏍囪瘑鐮併�� + /// </summary> + [SugarColumn(ColumnName = "MaterielCode", Length = 50, IsNullable = false, ColumnDescription = "浜у搧缂栫爜锛屼骇鍝佺殑鍞竴鏍囪瘑鐮併��")] + public string MaterielCode { get; set; } + + /// <summary> + /// 浜у搧鍚嶇О銆� + /// </summary> + [SugarColumn(ColumnName = "MaterielName", Length = 100, IsNullable = true, ColumnDescription = "浜у搧鍚嶇О銆�")] + public string? MaterielName { get; set; } + + /// <summary> + /// 瑙勬牸鍨嬪彿锛屼骇鍝佺殑瑙勬牸鎴栧瀷鍙枫�� + /// </summary> + [SugarColumn(ColumnName = "Specification", Length = 100, IsNullable = true, ColumnDescription = "瑙勬牸鍨嬪彿锛屼骇鍝佺殑瑙勬牸鎴栧瀷鍙枫��")] + public string? Specification { get; set; } + + /// <summary> + /// 鍗曚綅锛屼骇鍝佺殑璁¢噺鍗曚綅锛堝锛氫欢銆佺銆佹墭鐩橈級銆� + /// </summary> + [SugarColumn(ColumnName = "Unit", Length = 20, IsNullable = true, ColumnDescription = "鍗曚綅锛屼骇鍝佺殑璁¢噺鍗曚綅锛堝锛氫欢銆佺銆佹墭鐩橈級銆�")] + public string? Unit { get; set; } + + /// <summary> + /// 闇�姹傛暟閲忥紝璁㈠崟涓渶瑕佸垎鎷g殑浜у搧鏁伴噺銆� + /// </summary> + [SugarColumn(ColumnName = "RequiredQuantity", IsNullable = true, ColumnDescription = "闇�姹傛暟閲忥紝璁㈠崟涓渶瑕佸垎鎷g殑浜у搧鏁伴噺銆�")] + public int? RequiredQuantity { get; set; } + + /// <summary> + /// 鍒嗘嫞鏁伴噺锛屽疄闄呭垎鎷g殑浜у搧鏁伴噺銆� + /// </summary> + [SugarColumn(ColumnName = "SortedQuantity", IsNullable = true, ColumnDescription = "鍒嗘嫞鏁伴噺锛屽疄闄呭垎鎷g殑浜у搧鏁伴噺銆�")] + public int? SortedQuantity { get; set; } + + /// <summary> + /// 搴撳瓨浣嶇疆锛屼骇鍝佸湪浠撳簱涓殑瀛樺偍浣嶇疆銆� + /// </summary> + [SugarColumn(ColumnName = "StockLocation", Length = 50, IsNullable = true, ColumnDescription = "搴撳瓨浣嶇疆锛屼骇鍝佸湪浠撳簱涓殑瀛樺偍浣嶇疆銆�")] + public string? StockLocation { get; set; } + + /// <summary> + /// 鍒嗘嫞椤哄簭锛屽垎鎷d换鍔$殑鎵ц椤哄簭銆� + /// </summary> + [SugarColumn(ColumnName = "SortingOrder", IsNullable = true, ColumnDescription = "鍒嗘嫞椤哄簭锛屽垎鎷d换鍔$殑鎵ц椤哄簭銆�")] + public int? SortingOrder { get; set; } + + /// <summary> + /// 鍒嗘嫞鍖哄煙锛屼骇鍝佹墍鍦ㄧ殑浠撳簱鍖哄煙銆� + /// </summary> + [SugarColumn(ColumnName = "SortingZone", Length = 50, IsNullable = true, ColumnDescription = "鍒嗘嫞鍖哄煙锛屼骇鍝佹墍鍦ㄧ殑浠撳簱鍖哄煙銆�")] + public string? SortingZone { get; set; } + + /// <summary> + /// 鍒嗘嫞鏂瑰紡锛屽垎鎷g殑鏂规硶锛堝锛氫汉宸ュ垎鎷c�佽嚜鍔ㄥ寲鍒嗘嫞锛夈�� + /// </summary> + [SugarColumn(ColumnName = "SortingMethod", Length = 50, IsNullable = true, ColumnDescription = "鍒嗘嫞鏂瑰紡锛屽垎鎷g殑鏂规硶锛堝锛氫汉宸ュ垎鎷c�佽嚜鍔ㄥ寲鍒嗘嫞锛夈��")] + public string? SortingMethod { get; set; } + + /// <summary> + /// 鍒嗘嫞澶囨敞锛屽垎鎷h繃绋嬩腑鐨勭壒娈婅鏄庢垨娉ㄦ剰浜嬮」銆� + /// </summary> + [SugarColumn(ColumnName = "SortingRemarks", Length = 500, IsNullable = true, ColumnDescription = "鍒嗘嫞澶囨敞锛屽垎鎷h繃绋嬩腑鐨勭壒娈婅鏄庢垨娉ㄦ剰浜嬮」銆�")] + public string? SortingRemarks { get; set; } + + /// <summary> + /// 鍒嗘嫞瀹屾垚鏃堕棿锛屽垎鎷d换鍔″畬鎴愮殑鍏蜂綋鏃堕棿銆� + /// </summary> + [SugarColumn(ColumnName = "SortingCompletionTime", IsNullable = true, ColumnDescription = "鍒嗘嫞瀹屾垚鏃堕棿锛屽垎鎷d换鍔″畬鎴愮殑鍏蜂綋鏃堕棿銆�")] + public DateTime? SortingCompletionTime { get; set; } + + /// <summary> + /// 鍒嗘嫞宸紓锛岄渶姹傛暟閲忎笌鍒嗘嫞鏁伴噺鐨勫樊寮傘�� + /// </summary> + [SugarColumn(ColumnName = "SortingDifference", IsNullable = true, ColumnDescription = "鍒嗘嫞宸紓锛岄渶姹傛暟閲忎笌鍒嗘嫞鏁伴噺鐨勫樊寮傘��")] + public int? SortingDifference { get; set; } + + /// <summary> + /// 宸紓鍘熷洜锛屽垎鎷e樊寮傜殑鍘熷洜锛堝锛氬簱瀛樹笉瓒炽�佸垎鎷i敊璇級銆� + /// </summary> + [SugarColumn(ColumnName = "DifferenceReason", Length = 500, IsNullable = true, ColumnDescription = "宸紓鍘熷洜锛屽垎鎷e樊寮傜殑鍘熷洜锛堝锛氬簱瀛樹笉瓒炽�佸垎鎷i敊璇級銆�")] + public string? DifferenceReason { get; set; } + + /// <summary> + /// 澶嶆牳鍛橈紝瀵瑰垎鎷g粨鏋滆繘琛屽鏍哥殑鍛樺伐濮撳悕鎴栫紪鍙枫�� + /// </summary> + [SugarColumn(ColumnName = "Reviewer", Length = 50, IsNullable = true, ColumnDescription = "澶嶆牳鍛橈紝瀵瑰垎鎷g粨鏋滆繘琛屽鏍哥殑鍛樺伐濮撳悕鎴栫紪鍙枫��")] + public string? Reviewer { get; set; } + + /// <summary> + /// 澶嶆牳缁撴灉锛屽鏍哥殑缁撴灉锛堝锛氶�氳繃銆侀渶閲嶆柊鍒嗘嫞锛夈�� + /// </summary> + [SugarColumn(ColumnName = "ReviewResult", Length = 50, IsNullable = true, ColumnDescription = "澶嶆牳缁撴灉锛屽鏍哥殑缁撴灉锛堝锛氶�氳繃銆侀渶閲嶆柊鍒嗘嫞锛夈��")] + public string? ReviewResult { get; set; } + + /// <summary> + /// 澶囨敞锛屽叾浠栭渶瑕佽褰曠殑淇℃伅鎴栫壒娈婅鏄庛�� + /// </summary> + [SugarColumn(ColumnName = "Comments", Length = 500, IsNullable = true, ColumnDescription = "澶囨敞锛屽叾浠栭渶瑕佽褰曠殑淇℃伅鎴栫壒娈婅鏄庛��")] + public string? Comments { get; set; } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/OutboundOrder/Dt_OutOrderTransfer.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/OutboundOrder/Dt_OutOrderTransfer.cs" new file mode 100644 index 0000000..9f566f4 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/OutboundOrder/Dt_OutOrderTransfer.cs" @@ -0,0 +1,60 @@ +锘縰sing SqlSugar; +using WIDESEA_Core.DB.Models; + +namespace WIDESEA_Model.Models; + +/// <summary> +/// 璋冩嫧鍑哄簱鍗曞ご琛� +///</summary> +[SugarTable("Dt_OutOrderTransfer", "璋冩嫧鍑哄簱鍗曞ご琛�")] +public class Dt_OutOrderTransfer : BaseEntity +{ + /// <summary> + /// 澶� 娉�:涓婚敭锛岃嚜鍔ㄥ闀� + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "Id", IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "涓婚敭锛岃嚜鍔ㄥ闀�")] + public int Id { get; set; } + + /// <summary> + /// 澶� 娉�:鍗曟嵁缂栧彿 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "OrderNumber", ColumnDescription = "鍗曟嵁缂栧彿", Length = 50)] + public string OrderNumber { get; set; } = null!; + + /// <summary> + /// 澶� 娉�:鍗曟嵁鏃ユ湡 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "OrderDate", ColumnDescription = "鍗曟嵁鏃ユ湡")] + public DateTime OrderDate { get; set; } + + /// <summary> + /// 澶� 娉�:婧愪粨搴揑D + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "SourceWarehouseId", ColumnDescription = "婧愪粨搴揑D", IsNullable = true)] + public int SourceWarehouseId { get; set; } + + /// <summary> + /// 澶� 娉�:鐩爣浠撳簱ID + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "DestinationWarehouseId", ColumnDescription = "鐩爣浠撳簱ID", IsNullable = true)] + public int DestinationWarehouseId { get; set; } + + /// <summary> + /// 澶� 娉�:鍗曟嵁鐘舵�� + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "Status", ColumnDescription = "鍗曟嵁鐘舵��")] + public int Status { get; set; } + + /// <summary> + /// 澶� 娉�:澶囨敞 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "Remarks", ColumnDescription = "澶囨敞", IsNullable = true, Length = 100)] + public string? Remarks { get; set; } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/OutboundOrder/Dt_OutOrderTransferDetail.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/OutboundOrder/Dt_OutOrderTransferDetail.cs" new file mode 100644 index 0000000..603bc64 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/OutboundOrder/Dt_OutOrderTransferDetail.cs" @@ -0,0 +1,53 @@ +锘縰sing SqlSugar; +using WIDESEA_Core.DB.Models; + +namespace WIDESEA_Model.Models; + +/// <summary> +/// 璋冩嫧鍑哄簱鍗曟槑缁嗚〃 +///</summary> +[SugarTable("Dt_OutOrderTransferDetail", "璋冩嫧鍑哄簱鍗曟槑缁嗚〃")] +public class Dt_OutOrderTransferDetail : BaseEntity +{ + /// <summary> + /// 澶� 娉�:涓婚敭锛岃嚜鍔ㄥ闀� + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "Id", IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "涓婚敭锛岃嚜鍔ㄥ闀�")] + public int Id { get; set; } + + /// <summary> + /// 澶� 娉�:璋冩嫧鍑哄簱鍗旾D锛堝閿級 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "TransferOutOrderId", ColumnDescription = "璋冩嫧鍑哄簱鍗旾D锛堝閿級")] + public int TransferOutOrderId { get; set; } + + /// <summary> + /// 澶� 娉�:鐗╂枡ID + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "MaterialId", ColumnDescription = "鐗╂枡ID")] + public int MaterialId { get; set; } + + /// <summary> + /// 澶� 娉�:鏁伴噺 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "Quantity", ColumnDescription = "鏁伴噺")] + public decimal Quantity { get; set; } + + /// <summary> + /// 澶� 娉�:澶囨敞 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "Remarks", ColumnDescription = "澶囨敞", IsNullable = true, Length = 100)] + public string? Remarks { get; set; } + + /// <summary> + /// 澶� 娉�:鎵规鍙� + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "BatchNumber", ColumnDescription = "鎵规鍙�", Length = 100)] + public string? BatchNumber { get; set; } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/OutboundOrder/Dt_OutOrderTransferDetail_Hty.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/OutboundOrder/Dt_OutOrderTransferDetail_Hty.cs" new file mode 100644 index 0000000..c4abf92 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/OutboundOrder/Dt_OutOrderTransferDetail_Hty.cs" @@ -0,0 +1,75 @@ +锘縰sing SqlSugar; +using WIDESEA_Core.DB.Models; + +namespace WIDESEA_Model.Models +{ + /// <summary> + /// 璋冩嫧鍑哄簱鍗曟槑缁嗚〃鍘嗗彶 + ///</summary> + [SugarTable("Dt_OutOrderTransferDetail_Hty", "璋冩嫧鍑哄簱鍗曟槑缁嗚〃鍘嗗彶")] + public class Dt_OutOrderTransferDetail_Hty : BaseEntity + { + /// <summary> + /// 澶� 娉�:涓婚敭锛岃嚜鍔ㄥ闀� + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "Id", IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "涓婚敭")] + public int Id { get; set; } + + /// <summary> + /// 澶� 娉�:璋冩嫧鍑哄簱鍗旾D锛堝閿級 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "TransferOutOrderId", ColumnDescription = "璋冩嫧鍑哄簱鍗旾D")] + public int TransferOutOrderId { get; set; } + + /// <summary> + /// 澶� 娉�:鐗╂枡ID + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "MaterialId", ColumnDescription = "鐗╂枡ID")] + public int MaterialId { get; set; } + + /// <summary> + /// 澶� 娉�:鏁伴噺 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "Quantity", ColumnDescription = "鏁伴噺")] + public decimal Quantity { get; set; } + + /// <summary> + /// 澶� 娉�:澶囨敞 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "Remarks", ColumnDescription = "澶囨敞", IsNullable = true, Length = 100)] + public string? Remarks { get; set; } + + /// <summary> + /// 澶� 娉�:鎵规鍙� + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "BatchNumber", ColumnDescription = "鎵规鍙�", Length = 50)] + public string? BatchNumber { get; set; } + + /// <summary> + /// 澶� 娉�:瀹屾垚鏃堕棿 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "FinishTime", ColumnDescription = "瀹屾垚鏃堕棿")] + public DateTime FinishTime { get; set; } + + /// <summary> + /// 澶� 娉�:鎿嶄綔绫诲瀷 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "OperateType", ColumnDescription = "鎿嶄綔绫诲瀷")] + public int OperateType { get; set; } + + /// <summary> + /// 澶� 娉�:婧愬崟ID + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "SourceId", ColumnDescription = "婧愬崟ID")] + public int SourceId { get; set; } + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/OutboundOrder/Dt_OutOrderTransfer_Hty.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/OutboundOrder/Dt_OutOrderTransfer_Hty.cs" new file mode 100644 index 0000000..13e1bde --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/OutboundOrder/Dt_OutOrderTransfer_Hty.cs" @@ -0,0 +1,81 @@ +锘縰sing SqlSugar; +using WIDESEA_Core.DB.Models; + +namespace WIDESEA_Model.Models; + +/// <summary> +/// 璋冩嫧鍑哄簱鍗曞ご琛ㄥ巻鍙� +///</summary> +[SugarTable("Dt_OutOrderTransfer_Hty", "璋冩嫧鍑哄簱鍗曞ご琛ㄥ巻鍙�")] +public class Dt_OutOrderTransfer_Hty : BaseEntity +{ + /// <summary> + /// 澶� 娉�:涓婚敭锛岃嚜鍔ㄥ闀� + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "Id", IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "涓婚敭锛岃嚜鍔ㄥ闀�")] + public int Id { get; set; } + + /// <summary> + /// 澶� 娉�:鍗曟嵁缂栧彿 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "OrderNumber", ColumnDescription = "鍗曟嵁缂栧彿", Length = 50)] + public string OrderNumber { get; set; } = null!; + + /// <summary> + /// 澶� 娉�:鍗曟嵁鏃ユ湡 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "OrderDate", ColumnDescription = "鍗曟嵁鏃ユ湡")] + public DateTime OrderDate { get; set; } + + /// <summary> + /// 澶� 娉�:婧愪粨搴揑D + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "SourceWarehouseId", ColumnDescription = "婧愪粨搴揑D", IsNullable = true)] + public int SourceWarehouseId { get; set; } + + /// <summary> + /// 澶� 娉�:鐩爣浠撳簱ID + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "DestinationWarehouseId", ColumnDescription = "鐩爣浠撳簱ID", IsNullable = true)] + public int DestinationWarehouseId { get; set; } + + /// <summary> + /// 澶� 娉�:鍗曟嵁鐘舵�� + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "Status", ColumnDescription = "鍗曟嵁鐘舵��")] + public int Status { get; set; } + + /// <summary> + /// 澶� 娉�:澶囨敞 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "Remarks", ColumnDescription = "澶囨敞", IsNullable = true, Length = 100)] + public string? Remarks { get; set; } + + /// <summary> + /// 澶� 娉�:瀹屾垚鏃堕棿 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "FinishTime", ColumnDescription = "瀹屾垚鏃堕棿")] + public DateTime FinishTime { get; set; } + + /// <summary> + /// 澶� 娉�:鎿嶄綔绫诲瀷 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "OperateType", ColumnDescription = "鎿嶄綔绫诲瀷")] + public int OperateType { get; set; } + + /// <summary> + /// 澶� 娉�:婧愬崟ID + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "SourceId", ColumnDescription = "婧愬崟ID")] + public int SourceId { get; set; } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/OutboundOrder/Dt_OutOrder_Hty.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/OutboundOrder/Dt_OutOrder_Hty.cs" new file mode 100644 index 0000000..c56afc1 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/OutboundOrder/Dt_OutOrder_Hty.cs" @@ -0,0 +1,88 @@ +锘縰sing SqlSugar; +using WIDESEA_Core.DB.Models; + +namespace WIDESEA_Model.Models; + +/// <summary> +/// 绯荤粺鍑哄簱璁㈠崟澶村巻鍙茶〃 +///</summary> +[SugarTable("Dt_OutOrder_Hty", "绯荤粺鍑哄簱璁㈠崟澶村巻鍙茶〃")] +public class Dt_OutOrder_Hty : BaseEntity +{ + /// <summary> + /// 澶� 娉�:涓婚敭锛岃嚜鍔ㄥ闀� + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "Id", IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "涓婚敭锛岃嚜鍔ㄥ闀�")] + public int Id { get; set; } + + /// <summary> + /// 澶� 娉�:鍑哄簱鍗曞彿 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "OrderNumber", ColumnDescription = "鍑哄簱鍗曞彿", IsNullable = false, Length = 30)] + public string OrderNumber { get; set; } = null!; + + /// <summary> + /// 澶� 娉�: 鍑哄簱鏃ユ湡 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "OrderDate", ColumnDescription = "鍑哄簱鏃ユ湡", IsNullable = false)] + public DateTime OrderDate { get; set; } + + /// <summary> + /// 澶� 娉�: 浠撳簱ID + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "WarehouseId", ColumnDescription = "浠撳簱ID", IsNullable = false)] + public int WarehouseId { get; set; } + + /// <summary> + /// 澶� 娉�: 鍗曟嵁鐘舵�� + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "Status", ColumnDescription = "鍗曟嵁鐘舵��", IsNullable = false)] + public int Status { get; set; } + + /// <summary> + /// 澶� 娉�: 涓婃湁绯荤粺鍗曟嵁ID + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "UpperOutOrderId", ColumnDescription = "涓婃湁绯荤粺鍗曟嵁ID", IsNullable = false)] + public int? UpperOutOrderId { get; set; } + + /// <summary> + /// 澶� 娉�: 澶囨敞 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "Remarks", ColumnDescription = "澶囨敞", IsNullable = false, Length = 100)] + public string? Remarks { get; set; } + + /// <summary> + /// 澶� 娉�: 瀹屾垚鏃堕棿 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "FinishTime", ColumnDescription = "瀹屾垚鏃堕棿", IsNullable = true)] + public DateTime FinishTime { get; set; } + + /// <summary> + /// 澶� 娉�: 鎿嶄綔绫诲瀷 + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "OperateType", ColumnDescription = "鎿嶄綔绫诲瀷", IsNullable = false)] + public int OperateType { get; set; } + + /// <summary> + /// 澶� 娉�: 婧愬崟ID + /// 榛樿鍊�: + ///</summary> + [SugarColumn(ColumnName = "SourceId", ColumnDescription = "婧愬崟ID", IsNullable = false)] + public int SourceId { get; set; } + + /// <summary> + /// 璁㈠崟鏄庣粏鏁版嵁 + /// </summary> + [SugarColumn(IsIgnore = true)] + [Navigate(NavigateType.OneToOne, nameof(Id), nameof(Dt_OutOrderDetail_Hty.Id))] + public Dt_OutOrderDetail_Hty? orderDetailList { get; set; } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/System/RoleAuthor.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/System/RoleAuthor.cs" new file mode 100644 index 0000000..4cd4407 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/System/RoleAuthor.cs" @@ -0,0 +1,14 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WIDESEA_Model +{ + public class RoleAuthor + { + public int menuId { get; set; } + public string actions { get; set; } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/System/RoleNodes.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/System/RoleNodes.cs" new file mode 100644 index 0000000..25b6b51 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/System/RoleNodes.cs" @@ -0,0 +1,15 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WIDESEA_Model.Models.System +{ + public class RoleNodes + { + public int Id { get; set; } + public int ParentId { get; set; } + public string RoleName { get; set; } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/System/Sys_CompanyRegistration.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/System/Sys_CompanyRegistration.cs" new file mode 100644 index 0000000..da955d6 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/System/Sys_CompanyRegistration.cs" @@ -0,0 +1,62 @@ +锘縰sing SqlSugar; +using WIDESEA_Core.DB.Models; + +namespace WIDESEA_Model.Models; + +[SugarTable("Sys_CompanyRegistration", "寰呮敞鍐岃〃")] +public class Sys_CompanyRegistration : BaseEntity +{ + /// <summary> + /// 涓婚敭锛岃嚜鍔ㄩ�掑 + /// </summary> + [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "涓婚敭锛岃嚜鍔ㄩ�掑")] + public int Id { get; set; } + + /// <summary> + /// 鍏徃鍚嶇О + /// </summary> + [SugarColumn(ColumnDataType = "nvarchar", Length = 255, IsNullable = false, ColumnDescription = "鍏徃鍚嶇О")] + public string CompanyName { get; set; } + + /// <summary> + /// 鍏徃绫诲瀷 + /// </summary> + [SugarColumn(ColumnDataType = "nvarchar", Length = 100, IsNullable = false, ColumnDescription = "鍏徃绫诲瀷")] + public string CompanyType { get; set; } + + /// <summary> + /// 琛屼笟绫诲埆 + /// </summary> + [SugarColumn(ColumnDataType = "nvarchar", Length = 100, IsNullable = false, ColumnDescription = "琛屼笟绫诲埆")] + public string Industry { get; set; } + + /// <summary> + /// 鑱旂郴浜哄鍚� + /// </summary> + [SugarColumn(ColumnDataType = "nvarchar", Length = 100, IsNullable = false, ColumnDescription = "鑱旂郴浜哄鍚�")] + public string ContactName { get; set; } + + /// <summary> + /// 鑱旂郴浜虹數璇� + /// </summary> + [SugarColumn(ColumnDataType = "nvarchar", Length = 50, IsNullable = false, ColumnDescription = "鑱旂郴浜虹數璇�")] + public string ContactPhone { get; set; } + + /// <summary> + /// 鑱旂郴浜虹數瀛愰偖绠� + /// </summary> + [SugarColumn(ColumnDataType = "nvarchar", Length = 255, IsNullable = false, ColumnDescription = "鑱旂郴浜虹數瀛愰偖绠�")] + public string ContactEmail { get; set; } + + /// <summary> + /// 鍚屾剰浣跨敤鏉℃鍜岄殣绉佹斂绛� + /// </summary> + [SugarColumn(IsNullable = false, ColumnDescription = "鍚屾剰浣跨敤鏉℃鍜岄殣绉佹斂绛�")] + public bool AgreeTerms { get; set; } + + /// <summary> + /// 娉ㄥ唽鐘舵�� + /// </summary> + [SugarColumn(ColumnDataType = "nvarchar", Length = 50, IsNullable = false, ColumnDescription = "娉ㄥ唽鐘舵��")] + public string RegistrationStatus { get; set; } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/System/Sys_Config.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/System/Sys_Config.cs" new file mode 100644 index 0000000..e4edf2d --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/System/Sys_Config.cs" @@ -0,0 +1,53 @@ +锘縰sing SqlSugar; +using WIDESEA_Core.DB.Models; + +namespace WIDESEA_Model.Models; + +/// <summary> +/// 绯荤粺閰嶇疆琛� +/// </summary> +[SugarTable("Sys_Config", "绯荤粺閰嶇疆琛�")] +public class Sys_Config : BaseEntity +{ + /// <summary> + /// 涓婚敭 + /// </summary> + [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "涓婚敭")] + public int Id { get; set; } + + /// <summary> + /// 閰嶇疆閿� + /// </summary> + [SugarColumn(ColumnDescription = "閰嶇疆閿�", Length = 255, IsNullable = false)] + public string ConfigKey { get; set; } + + /// <summary> + /// 閰嶇疆鍊� + /// </summary> + [SugarColumn(ColumnDescription = "閰嶇疆鍊�", IsNullable = false, ColumnDataType = "text")] + public string ConfigValue { get; set; } + + /// <summary> + /// 鍒嗙被 + /// </summary> + [SugarColumn(ColumnDescription = "鍒嗙被", Length = 255, IsNullable = false)] + public string Category { get; set; } + + /// <summary> + /// 澶囨敞 + /// </summary> + [SugarColumn(ColumnDescription = "澶囨敞", Length = 255, IsNullable = true)] + public string Remark { get; set; } + + /// <summary> + /// 鎺掑簭鐮� + /// </summary> + [SugarColumn(ColumnDescription = "鎺掑簭鐮�", IsNullable = true)] + public int? SortCode { get; set; } + + /// <summary> + /// 鐘舵�� + /// </summary> + [SugarColumn(ColumnDescription = "鐘舵��", Length = 20, IsNullable = true)] + public string Status { get; set; } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/System/Sys_Department.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/System/Sys_Department.cs" new file mode 100644 index 0000000..1ac637a --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/System/Sys_Department.cs" @@ -0,0 +1,57 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using SqlSugar; +using WIDESEA_Core.DB.Models; +using WIDESEA_Core.Tenants; + +namespace WIDESEA_Model.Models +{ + [SugarTable("Sys_Department", "缁勭粐鏋舵瀯"), MultiTenant] + public class Sys_Department : BaseEntity + { + /// <summary> + /// 缁勭粐ID + /// </summary> + [SugarColumn(IsIdentity = true, IsPrimaryKey = true, ColumnDescription = "缁勭粐ID")] + public int DepartmentId { get; set; } + + /// <summary> + /// 缁勭粐鍚嶇О + /// </summary> + [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "缁勭粐鍚嶇О")] + public string DepartmentName { get; set; } + + /// <summary> + /// 缁勭粐缂栧彿 + /// </summary> + [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "缁勭粐缂栧彿")] + public string DepartmentCode { get; set; } + + /// <summary> + /// 涓婄骇缁勭粐 + /// </summary> + [SugarColumn(IsNullable = false, ColumnDescription = "涓婄骇缁勭粐")] + public int ParentId { get; set; } + + /// <summary> + /// 閮ㄩ棬绫诲瀷 + /// </summary> + [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "閮ㄩ棬绫诲瀷")] + public string DepartmentType { get; set; } + + /// <summary> + /// 鏄惁鍙敤 + /// </summary> + [SugarColumn(IsNullable = false, ColumnDescription = "鏄惁鍙敤")] + public int Enable { get; set; } + + /// <summary> + /// 澶囨敞 + /// </summary> + [SugarColumn(IsNullable = true, Length = 2000, ColumnDescription = "澶囨敞")] + public string Remark { get; set; } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/System/Sys_Dictionary.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/System/Sys_Dictionary.cs" new file mode 100644 index 0000000..ea9724b --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/System/Sys_Dictionary.cs" @@ -0,0 +1,95 @@ +锘縰sing Magicodes.ExporterAndImporter.Core; +using SqlSugar; +using WIDESEA_Core.DB.Models; +using WIDESEA_Core.Filter; +using WIDESEA_Core.Tenants; + +namespace WIDESEA_Model.Models +{ + [MultiTenant] + [Exporter(ExporterHeaderFilter = typeof(ExporterHeaderFilter))] + [SugarTable("Sys_Dictionary", "瀛楀吀鏁版嵁")] + public class Sys_Dictionary : BaseEntity + { + /// <summary> + /// 瀛楀吀ID + /// </summary> + [ExporterHeader(DisplayName = "瀛楀吀ID")] + [SugarColumn(IsIdentity = true, IsPrimaryKey = true, ColumnDescription = "瀛楀吀ID")] + public int DicId { get; set; } + + /// <summary> + /// 閰嶇疆椤� + /// </summary> + [ExporterHeader(DisplayName = "閰嶇疆椤�")] + [SugarColumn(IsNullable = true, Length = 200, ColumnDescription = "閰嶇疆椤�")] + public string Config { get; set; } + + /// <summary> + /// 鏁版嵁搴撴湇鍔� + /// </summary> + [ExporterHeader(DisplayName = "鏁版嵁搴撴湇鍔�")] + [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "鏁版嵁搴撴湇鍔�")] + public string DBServer { get; set; } + + /// <summary> + /// Sql璇彞 + /// </summary> + [ExporterHeader(DisplayName = "Sql璇彞")] + [SugarColumn(IsNullable = true, Length = 500, ColumnDescription = "Sql璇彞")] + public string DBSql { get; set; } + + /// <summary> + /// 瀛楀吀鍚嶇О + /// </summary> + [ExporterHeader(DisplayName = "瀛楀吀鍚嶇О")] + [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "瀛楀吀鍚嶇О")] + public string DicName { get; set; } + + /// <summary> + /// 瀛楀吀缂栧彿 + /// </summary> + [ExporterHeader(DisplayName = "瀛楀吀缂栧彿")] + [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "瀛楀吀缂栧彿")] + public string DicNo { get; set; } + + /// <summary> + /// 鏄惁鍚敤 + /// </summary> + [ExporterHeader(DisplayName = "鏄惁鍚敤")] + [SugarColumn(IsNullable = true, ColumnDescription = "鏄惁鍚敤")] + public byte? Enable { get; set; } + + /// <summary> + /// 鎺掑簭鍙� + /// </summary> + [ExporterHeader(DisplayName = "鎺掑簭鍙�")] + [SugarColumn(IsNullable = true, ColumnDescription = "鎺掑簭鍙�")] + public int? OrderNo { get; set; } + + /// <summary> + /// 鐖剁骇ID + /// </summary> + [ExporterHeader(DisplayName = "鐖剁骇ID")] + [SugarColumn(IsNullable = true, ColumnDescription = "鐖剁骇ID")] + public int ParentId { get; set; } + + /// <summary> + /// 澶囨敞 + /// </summary> + [ExporterHeader(DisplayName = "澶囨敞")] + [SugarColumn(IsNullable = true, Length = 2000, ColumnDescription = "澶囨敞")] + public string Remark { get; set; } + + /// <summary> + /// 绯荤粺绫诲瀷 + /// </summary> + [ExporterHeader(DisplayName = "绯荤粺绫诲瀷")] + [SugarColumn(IsNullable = false, ColumnDescription = "绯荤粺绫诲瀷")] + public int SystemType { get; set; } + + [ExporterHeader(IsIgnore = true)] + [Navigate(NavigateType.OneToMany, nameof(DicId),nameof(DicId)), SugarColumn(IsIgnore = true, IsNullable = true)] + public List<Sys_DictionaryList> DicList { get; set; } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/System/Sys_DictionaryList.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/System/Sys_DictionaryList.cs" new file mode 100644 index 0000000..e29f6fc --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/System/Sys_DictionaryList.cs" @@ -0,0 +1,57 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Core.DB.Models; +using SqlSugar; +using WIDESEA_Core.Tenants; + +namespace WIDESEA_Model.Models +{ + [SugarTable("Sys_DictionaryList", "瀛楀吀鏄庣粏"), MultiTenant] + public class Sys_DictionaryList : BaseEntity + { + /// <summary> + /// 瀛楀吀鍒楄〃ID + /// </summary> + [SugarColumn(IsIdentity = true, IsPrimaryKey = true, ColumnDescription = "瀛楀吀鍒楄〃ID")] + public int DicListId { get; set; } + + /// <summary> + /// 鏁版嵁婧怲ext + /// </summary> + [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "鏁版嵁婧怲ext")] + public string DicName { get; set; } + + /// <summary> + /// 鏁版嵁婧怴alue + /// </summary> + [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "鏁版嵁婧怴alue")] + public string DicValue { get; set; } + + /// <summary> + /// 鏁版嵁婧怚D + /// </summary> + [SugarColumn(IsNullable = false, ColumnDescription = "鏁版嵁婧怚D")] + public int DicId { get; set; } + + /// <summary> + /// 鏄惁鍙敤 + /// </summary> + [SugarColumn(IsNullable = true, ColumnDescription = "鏄惁鍙敤")] + public byte? Enable { get; set; } + + /// <summary> + /// 鎺掑簭鍙� + /// </summary> + [SugarColumn(IsNullable = true, ColumnDescription = "鎺掑簭鍙�")] + public int? OrderNo { get; set; } + + /// <summary> + /// 澶囨敞 + /// </summary> + [SugarColumn(IsNullable = true, Length = 2000, ColumnDescription = "澶囨敞")] + public string Remark { get; set; } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/System/Sys_ExteriorInterface.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/System/Sys_ExteriorInterface.cs" new file mode 100644 index 0000000..e1d3e24 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/System/Sys_ExteriorInterface.cs" @@ -0,0 +1,68 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using SqlSugar; +using WIDESEA_Core.DB.Models; +using WIDESEA_Core.Tenants; + +namespace WIDESEA_Model.Models +{ + [MultiTenant] + public class Sys_ExteriorInterface + { + /// <summary> + /// 涓婚敭 + /// </summary> + [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "涓婚敭")] + public int Id { get; set; } + + /// <summary> + /// ip + /// </summary> + [SugarColumn(IsNullable = true, ColumnDescription = "ip")] + public string Url { get; set; } + + /// <summary> + /// 绔彛 + /// </summary> + [SugarColumn(IsNullable = true, ColumnDescription = "绔彛")] + public string Port { get; set; } + + /// <summary> + /// 璺敱 + /// </summary> + [SugarColumn(IsNullable = true, ColumnDescription = "璺敱")] + public string Route { get; set; } + + /// <summary> + /// 鏃ュ織绫诲瀷 + /// </summary> + //[SugarColumn(IsNullable = true, ColumnDescription = "鏃ュ織绫诲瀷")] + //public DateTime LogType { get; set; } + + /// <summary> + /// 鏂规硶鍚� + /// </summary> + [SugarColumn(IsNullable = true, Length = 2000, ColumnDescription = "鏂规硶鍚�")] + public string Method { get; set; } + + /// <summary> + /// 璇锋眰鏂瑰紡 + /// </summary> + [SugarColumn(IsNullable = true, Length = 2000, ColumnDescription = "璇锋眰鏂瑰紡")] + public string Request { get; set; } + + /// <summary> + /// 浠ょ墝 + /// </summary> + [SugarColumn(IsNullable = true, ColumnDescription = "浠ょ墝")] + public string Authorized { get; set; } + + /// <summary> + /// 澶囨敞 + /// </summary> + [SugarColumn(IsNullable = true, Length = 2000, ColumnDescription = "澶囨敞")] + public string Remark { get; set; } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/System/Sys_Log.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/System/Sys_Log.cs" new file mode 100644 index 0000000..ed75231 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/System/Sys_Log.cs" @@ -0,0 +1,86 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using SqlSugar; +using WIDESEA_Core.DB.Models; +using WIDESEA_Core.Tenants; + +namespace WIDESEA_Model.Models +{ + [MultiTenant] + public class Sys_Log + { + /// <summary> + /// 涓婚敭 + /// </summary> + [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "涓婚敭")] + public int Id { get; set; } + + /// <summary> + /// 寮�濮嬫椂闂� + /// </summary> + [SugarColumn(IsNullable = true, ColumnDescription = "寮�濮嬫椂闂�")] + public DateTime? BeginDate { get; set; } + + /// <summary> + /// 鏃堕暱 + /// </summary> + [SugarColumn(IsNullable = true, ColumnDescription = "鏃堕暱")] + public int? ElapsedTime { get; set; } + + /// <summary> + /// 缁撴潫鏃堕棿 + /// </summary> + [SugarColumn(IsNullable = true, ColumnDescription = "缁撴潫鏃堕棿")] + public DateTime EndDate { get; set; } + + /// <summary> + /// 鏃ュ織绫诲瀷 + /// </summary> + //[SugarColumn(IsNullable = true, ColumnDescription = "鏃ュ織绫诲瀷")] + //public DateTime LogType { get; set; } + + /// <summary> + /// 璇锋眰鍙傛暟 + /// </summary> + [SugarColumn(IsNullable = true, Length = 2000, ColumnDescription = "璇锋眰鍙傛暟")] + public string RequestParam { get; set; } + + /// <summary> + /// 鍝嶅簲鍙傛暟 + /// </summary> + [SugarColumn(IsNullable = true, Length = 2000, ColumnDescription = "鍝嶅簲鍙傛暟")] + public string ResponseParam { get; set; } + + /// <summary> + /// 鍝嶅簲鐘舵�� + /// </summary> + [SugarColumn(IsNullable = true, ColumnDescription = "鍝嶅簲鐘舵��")] + public int? Success { get; set; } + + /// <summary> + /// 璇锋眰鍦板潃 + /// </summary> + [SugarColumn(IsNullable = true, Length = 2000, ColumnDescription = "璇锋眰鍦板潃")] + public string Url { get; set; } + + /// <summary> + /// 鐢ㄦ埛IP + /// </summary> + [SugarColumn(IsNullable = true, Length = 20, ColumnDescription = "鐢ㄦ埛IP")] + public string UserIP { get; set; } + + /// <summary> + /// 鐢ㄦ埛鍚嶇О + /// </summary> + [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "鐢ㄦ埛鍚嶇О")] + public string UserName { get; set; } + + /// <summary> + /// 鐢ㄦ埛涓婚敭 + /// </summary> + [SugarColumn(IsNullable = true, ColumnDescription = "鐢ㄦ埛涓婚敭")] + public int? User_Id { get; set; } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/System/Sys_Menu.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/System/Sys_Menu.cs" new file mode 100644 index 0000000..ff956ec --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/System/Sys_Menu.cs" @@ -0,0 +1,85 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using SqlSugar; +using WIDESEA_Core.DB.Models; +using WIDESEA_Core.Tenants; + +namespace WIDESEA_Model.Models +{ + [SugarTable("Sys_Menu", "鑿滃崟閰嶇疆"), MultiTenant] + public class Sys_Menu : BaseEntity + { + /// <summary> + /// 鑿滃崟ID + /// </summary> + [SugarColumn(IsIdentity = true, IsPrimaryKey = true, ColumnDescription = "鑿滃崟ID")] + public int MenuId { get; set; } + + /// <summary> + /// 鑿滃崟鍚嶇О + /// </summary> + [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "鑿滃崟鍚嶇О")] + public string MenuName { get; set; } + + /// <summary> + /// 鏉冮檺 + /// </summary> + [SugarColumn(IsNullable = true, Length = 2000, ColumnDescription = "鏉冮檺")] + public string Auth { get; set; } + + /// <summary> + /// 鍥炬爣 + /// </summary> + [SugarColumn(IsNullable = true, Length = 200, ColumnDescription = "鍥炬爣")] + public string Icon { get; set; } + + /// <summary> + /// 鎻忚堪 + /// </summary> + [SugarColumn(IsNullable = true, Length = 2000, ColumnDescription = "鎻忚堪")] + public string Description { get; set; } + + /// <summary> + /// 鏄惁鍚敤 + /// </summary> + [SugarColumn(IsNullable = true, ColumnDescription = "鏄惁鍚敤")] + public byte? Enable { get; set; } + + /// <summary> + /// 琛ㄥ悕 + /// </summary> + [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "琛ㄥ悕")] + public string TableName { get; set; } + + /// <summary> + /// 鐖剁骇ID + /// </summary> + [SugarColumn(IsNullable = false, ColumnDescription = "鐖剁骇ID")] + public int ParentId { get; set; } + + /// <summary> + /// 璺緞 + /// </summary> + [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "璺緞")] + public string Url { get; set; } + + /// <summary> + /// 鎺掑簭鍙� + /// </summary> + [SugarColumn(IsNullable = true,ColumnDescription ="鎺掑簭鍙�")] + public int? OrderNo { get; set; } + + /// <summary> + /// 鑿滃崟绫诲瀷 + /// </summary> + [SugarColumn(IsNullable = true, ColumnDescription = "鑿滃崟绫诲瀷")] + public int? MenuType { get; set; } + + [Navigate(NavigateType.OneToMany, nameof(ParentId), nameof(MenuId)), SugarColumn(IsIgnore = true, IsNullable = true)] + public List<Sys_Menu> Menus { get; set; } + + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/System/Sys_Role.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/System/Sys_Role.cs" new file mode 100644 index 0000000..cd54e64 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/System/Sys_Role.cs" @@ -0,0 +1,54 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using SqlSugar; +using WIDESEA_Core.DB.Models; +using WIDESEA_Core.Tenants; + +namespace WIDESEA_Model.Models +{ + [SugarTable("Sys_Role", "瑙掕壊琛�"), MultiTenant] + public class Sys_Role : BaseEntity + { + /// <summary> + /// 涓婚敭 + /// </summary> + [SugarColumn(IsIdentity = true, IsPrimaryKey = true, ColumnDescription = "涓婚敭")] + public int RoleId { get; set; } + + /// <summary> + /// 閮ㄩ棬鍚嶇О + /// </summary> + [SugarColumn(IsNullable = true,IsIgnore = true, Length = 50, ColumnDescription = "閮ㄩ棬鍚嶇О")] + public string DeptName { get; set; } + + /// <summary> + /// 閮ㄩ棬涓婚敭 + /// </summary> + [SugarColumn(IsNullable = true, ColumnDescription = "閮ㄩ棬涓婚敭")] + public int? DeptId { get; set; } + + /// <summary> + /// 鏄惁鍚敤 + /// </summary> + [SugarColumn(IsNullable = false, ColumnDescription = "鏄惁鍚敤")] + public byte Enable { get; set; } + + /// <summary> + /// 鐖禝D + /// </summary> + [SugarColumn(IsNullable = false, ColumnDescription = "鐖禝D")] + public int ParentId { get; set; } + + /// <summary> + /// 瑙掕壊鍚嶇О + /// </summary> + [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "瑙掕壊鍚嶇О")] + public string RoleName { get; set; } + + [Navigate(NavigateType.OneToMany, nameof(ParentId), nameof(RoleId)), SugarColumn(IsIgnore = true, IsNullable = true)] + public List<Sys_Role> Roles { get; set; } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/System/Sys_RoleAuth.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/System/Sys_RoleAuth.cs" new file mode 100644 index 0000000..1d9c5ff --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/System/Sys_RoleAuth.cs" @@ -0,0 +1,48 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using SqlSugar; +using WIDESEA_Core.DB.Models; +using WIDESEA_Core.Tenants; + +namespace WIDESEA_Model.Models +{ + /// <summary> + /// 瑙掕壊韬唤楠岃瘉绠$悊琛� + /// </summary> + [SugarTable("Sys_RoleAuth", "瑙掕壊韬唤楠岃瘉绠$悊"), MultiTenant] + public class Sys_RoleAuth : BaseEntity + { + /// <summary> + /// 瑙掕壊韬唤楠岃瘉ID + /// </summary> + [SugarColumn(IsIdentity = true, IsPrimaryKey = true, ColumnDescription = "瑙掕壊韬唤楠岃瘉ID")] + public int AuthId { get; set; } + + /// <summary> + /// 鐢ㄦ埛鏉冮檺 + /// </summary> + [SugarColumn(IsNullable = true, Length = 500, ColumnDescription = "鐢ㄦ埛鏉冮檺")] + public string AuthValue { get; set; } + + /// <summary> + /// 鑿滃崟ID + /// </summary> + [SugarColumn(IsNullable = false, ColumnDescription = "鑿滃崟ID")] + public int MenuId { get; set; } + + /// <summary> + /// 瑙掕壊ID + /// </summary> + [SugarColumn(IsNullable = true, ColumnDescription = "瑙掕壊ID")] + public int? RoleId { get; set; } + + /// <summary> + /// 鐢ㄦ埛ID + /// </summary> + [SugarColumn(IsNullable = true, ColumnDescription = "鐢ㄦ埛ID")] + public int? UserId { get; set; } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/System/Sys_Tenant.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/System/Sys_Tenant.cs" new file mode 100644 index 0000000..33836b0 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/System/Sys_Tenant.cs" @@ -0,0 +1,57 @@ +锘縰sing SqlSugar; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Core.DB.Models; +using WIDESEA_Core.Tenants; + +namespace WIDESEA_Model.Models +{ + [SugarTable("Sys_Tenant", "绉熸埛")] + public class Sys_Tenant : BaseEntity + { + /// <summary> + /// 绉熸埛ID + /// </summary> + [SugarColumn(IsIdentity = true, IsPrimaryKey = true, ColumnDescription = "绉熸埛ID")] + public int TenantId { get; set; } + + /// <summary> + /// 绉熸埛鍚嶇О + /// </summary> + [SugarColumn(Length = 200, IsNullable = false, ColumnDescription = "绉熸埛鍚嶇О")] + public string TenantName { get; set; } + + /// <summary> + /// 绉熸埛绫诲瀷 + /// </summary> + [SugarColumn(IsNullable = false, ColumnDescription = "绉熸埛绫诲瀷")] + public int TenantType { get; set; } + + /// <summary> + /// 鏁版嵁搴撶被鍨� + /// </summary> + [SugarColumn(IsNullable = false, ColumnDescription = "鏁版嵁搴撶被鍨�")] + public int DbType { get; set; } + + /// <summary> + /// 杩炴帴瀛楃涓� + /// </summary> + [SugarColumn(Length = 1000, IsNullable = false, ColumnDescription = "杩炴帴瀛楃涓�")] + public string ConnectionString { get; set; } + + /// <summary> + /// 鐘舵�� + /// </summary> + [SugarColumn(IsNullable = false, ColumnDescription = "鐘舵��")] + public int Status { get; set; } + + /// <summary> + /// 澶囨敞 + /// </summary> + [SugarColumn(Length = 2000, IsNullable = true, ColumnDescription = "澶囨敞")] + public string Remark { get; set; } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/System/Sys_Test.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/System/Sys_Test.cs" new file mode 100644 index 0000000..e2141c7 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/System/Sys_Test.cs" @@ -0,0 +1,31 @@ +锘縰sing Magicodes.ExporterAndImporter.Core; +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Core.DB.Models; +using WIDESEA_Core.Tenants; + +namespace WIDESEA_Model.Models +{ + [SugarTable("Sys_Test", "娴嬭瘯"), MultiTenant] + public class Sys_Test : BaseEntity + { + [ImporterHeader(Name = "Id")] + [ExporterHeader(DisplayName = "Id")] + [SugarColumn(IsIdentity = true, IsPrimaryKey = true, ColumnDescription = "Id")] + public int Id { get; set; } + + [ImporterHeader(Name = "娴嬭瘯Content")] + [ExporterHeader(DisplayName = "娴嬭瘯Content")] + [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "娴嬭瘯Content")] + public string TestContent { get; set; } + + [ImporterHeader(Name = "娴嬭瘯Count")] + [ExporterHeader(DisplayName = "娴嬭瘯Count")] + [SugarColumn(IsNullable = false, ColumnDescription = "娴嬭瘯Count")] + public int TestCount { get; set; } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/System/Sys_User.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/System/Sys_User.cs" new file mode 100644 index 0000000..2e15d5f --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/System/Sys_User.cs" @@ -0,0 +1,151 @@ +锘縰sing SqlSugar; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Core.DB.Models; +using WIDESEA_Core.Tenants; + +namespace WIDESEA_Model.Models +{ + /// <summary> + /// 鐢ㄦ埛淇℃伅琛� + /// </summary> + //[SugarTable("SysUserInfo")] + [SugarTable("Sys_User", "鐢ㄦ埛琛�")] //('鏁版嵁搴撹〃鍚�'锛�'鏁版嵁搴撹〃澶囨敞') + public class Sys_User : BaseEntity + { + /// <summary> + /// 鐢ㄦ埛ID + /// </summary> + [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "鐢ㄦ埛ID")] + public int User_Id { get; set; } + + /// <summary> + ///甯愬彿 + /// </summary> + [SugarColumn(Length = 100, IsNullable = false, ColumnDescription = "甯愬彿")] + public string UserName { get; set; } + + /// <summary> + /// 瑙掕壊ID + /// </summary> + [SugarColumn(IsNullable = false, ColumnDescription = "瑙掕壊ID")] + public int Role_Id { get; set; } + + /// <summary> + /// 瑙掕壊鍚嶇О + /// </summary> + [SugarColumn(Length = 100, IsNullable = true, ColumnDescription = "瑙掕壊鍚嶇О")] + public string RoleName { get; set; } + + /// <summary> + /// 鐢佃瘽 + /// </summary> + [SugarColumn(Length = 11, IsNullable = true, ColumnDescription = "鐢佃瘽")] + public string PhoneNo { get; set; } + + /// <summary> + /// 澶囨敞 + /// </summary> + [SugarColumn(Length = 200, IsNullable = true, ColumnDescription = "澶囨敞")] + public string Remark { get; set; } + + /// <summary> + /// 瀵嗙爜 + /// </summary> + [SugarColumn(Length = 200, IsNullable = false, ColumnDescription = "瀵嗙爜")] + public string UserPwd { get; set; } + + /// <summary> + /// 鐪熷疄濮撳悕 + /// </summary> + [SugarColumn(Length = 100, IsNullable = false, ColumnDescription = "鐪熷疄濮撳悕")] + public string UserTrueName { get; set; } + + /// <summary> + /// 閮ㄩ棬 + /// </summary> + [SugarColumn(Length = 100, IsNullable = true, ColumnDescription = "閮ㄩ棬")] + public string DeptName { get; set; } + + /// <summary> + /// 閮ㄩ棬ID + /// </summary> + [SugarColumn(IsNullable = true, ColumnDescription = "閮ㄩ棬ID")] + public int? Dept_Id { get; set; } + + /// <summary> + /// 閭 + /// </summary> + [SugarColumn(Length = 100, IsNullable = true, ColumnDescription = "閭")] + public string Email { get; set; } + + /// <summary> + /// 鏄惁鍙敤 + /// </summary> + [SugarColumn(IsNullable = false, ColumnDescription = "鏄惁鍙敤")] + public byte Enable { get; set; } + + /// <summary> + /// 鎬у埆 + /// </summary> + [SugarColumn(IsNullable = true, ColumnDescription = "鎬у埆")] + public int? Gender { get; set; } + + /// <summary> + /// 澶村儚 + /// </summary> + [SugarColumn(Length = 500, IsNullable = true, ColumnDescription = "澶村儚")] + public string HeadImageUrl { get; set; } + + /// <summary> + /// 鏈�鍚庡瘑鐮佷慨鏀规椂闂� + /// </summary> + [SugarColumn(IsNullable = true, IsOnlyIgnoreInsert = true, ColumnDescription = "鏈�鍚庡瘑鐮佷慨鏀规椂闂�")] + public DateTime? LastModifyPwdDate { get; set; } + + /// <summary> + /// 鍦板潃 + /// </summary> + [SugarColumn(Length = 200, IsNullable = true, ColumnDescription = "鍦板潃")] + public string Address { get; set; } + + /// <summary> + /// 瀹℃牳鏃堕棿 + /// </summary> + [SugarColumn(IsNullable = true, ColumnDescription = "瀹℃牳鏃堕棿")] + public DateTime? AuditDate { get; set; } + + /// <summary> + /// 瀹℃牳鐘舵�� + /// </summary> + [SugarColumn(IsNullable = true, ColumnDescription = "瀹℃牳鐘舵��")] + public int? AuditStatus { get; set; } + + /// <summary> + /// 瀹℃牳浜� + /// </summary> + [SugarColumn(Length = 100, IsNullable = true, ColumnDescription = "瀹℃牳浜�")] + public string Auditor { get; set; } + + /// <summary> + /// 浠ょ墝 + /// </summary> + [SugarColumn(Length = 500, IsNullable = true, ColumnDescription = "浠ょ墝")] + public string Token { get; set; } + + /// <summary> + /// 绯荤粺绫诲瀷 + /// </summary> + [SugarColumn(IsNullable = false, ColumnDescription = "绯荤粺绫诲瀷", DefaultValue = "0")] + public int SystemType { get; set; } + + /// <summary> + /// 绉熸埛ID + /// </summary> + [SugarColumn(IsNullable = false, ColumnDescription = "绉熸埛ID")] + public long TenantId { get; set; } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Repository/Sys_CompanyRegistrationRepository.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Repository/Sys_CompanyRegistrationRepository.cs" new file mode 100644 index 0000000..9a002d7 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Repository/Sys_CompanyRegistrationRepository.cs" @@ -0,0 +1,12 @@ +锘縰sing WIDESEA_Core.BaseRepository; +using WIDESEA_IRepository; +using WIDESEA_Model.Models; + +namespace WIDESEA_Repository; + +public class Sys_CompanyRegistrationRepository : RepositoryBase<Sys_CompanyRegistration>, ISys_CompanyRegistrationRepository +{ + public Sys_CompanyRegistrationRepository(IUnitOfWorkManage unitOfWorkManage) : base(unitOfWorkManage) + { + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Repository/Sys_ConfigRepository.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Repository/Sys_ConfigRepository.cs" new file mode 100644 index 0000000..09813fd --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Repository/Sys_ConfigRepository.cs" @@ -0,0 +1,21 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Core.BaseRepository; +using WIDESEA_Core.HttpContextUser; +using WIDESEA_IRepository; +using WIDESEA_Model; +using WIDESEA_Model.Models; + +namespace WIDESEA_Repository +{ + public class Sys_ConfigRepository : RepositoryBase<Sys_Config>, ISys_ConfigRepository + { + public Sys_ConfigRepository(IUnitOfWorkManage unitOfWorkManage) : base(unitOfWorkManage) + { + + } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Repository/Sys_DictionaryRepository.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Repository/Sys_DictionaryRepository.cs" new file mode 100644 index 0000000..d60dbd6 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Repository/Sys_DictionaryRepository.cs" @@ -0,0 +1,75 @@ +锘縰sing Microsoft.AspNetCore.DataProtection.KeyManagement; +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Core.BaseRepository; +using WIDESEA_IRepository; +using WIDESEA_Model.Models; + +namespace WIDESEA_Repository +{ + public class Sys_DictionaryRepository : RepositoryBase<Sys_Dictionary>, ISys_DictionaryRepository + { + public Sys_DictionaryRepository(IUnitOfWorkManage unitOfWorkManage) : base(unitOfWorkManage) + { + } + + /// <summary> + /// + /// </summary> + /// <param name="dicNos"></param> + /// <param name="executeSql">鏄惁鎵ц鑷畾涔塻ql</param> + /// <returns></returns> + public IEnumerable<Sys_Dictionary> GetDictionaries(IEnumerable<string> dicNos, bool executeSql = true) + { + List<Sys_Dictionary> Dictionaries = GetAllDictionary(); + + foreach (var item in Dictionaries.Where(x => dicNos.Contains(x.DicNo))) + { + if (executeSql) + { + // 2020.05.01澧炲姞鏍规嵁鐢ㄦ埛淇℃伅鍔犺浇瀛楀吀鏁版嵁婧恠ql + string sql = item.DBSql; + if (!string.IsNullOrEmpty(sql)) + { + item.DicList = Query(sql); + } + } + } + + return Dictionaries; + } + + List<Sys_DictionaryList> Query(string sql) + { + try + { + return base.QueryDynamicDataBySql(sql, null).Select(s => new Sys_DictionaryList() + { + DicName = s.Value, + DicValue = s.Key.ToString() + }).ToList(); + } + catch (Exception ex) + { + throw ex; + } + } + + private List<Sys_Dictionary> GetAllDictionary() + { + //base.QueryData().ToList(); + List<Sys_Dictionary> _dictionaries = Db.Queryable<Sys_Dictionary>().Includes(x => x.DicList).Where(x => x.Enable == 1).ToList(); + return _dictionaries; + } + } + + public class SourceKeyVaule + { + public object Key { get; set; } + public string Value { get; set; } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Repository/Sys_MenuRepository.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Repository/Sys_MenuRepository.cs" new file mode 100644 index 0000000..10f60dc --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Repository/Sys_MenuRepository.cs" @@ -0,0 +1,207 @@ +锘縰sing AutoMapper; +using SqlSugar; +using System; +using System.Collections.Concurrent; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Core; +using WIDESEA_Core.BaseRepository; +using WIDESEA_Core.Helper; +using WIDESEA_DTO.System; +using WIDESEA_IRepository; +using WIDESEA_Model; +using WIDESEA_Model.Models; + +namespace WIDESEA_Repository +{ + public class Sys_MenuRepository : RepositoryBase<Sys_Menu>, ISys_MenuRepository + { + private readonly IMapper _mapper; + public Sys_MenuRepository(IUnitOfWorkManage unitOfWorkManage, IMapper mapper) : base(unitOfWorkManage) + { + _mapper = mapper; + } + + public List<MenuDTO> GetAllMenu() + { + List<Sys_Menu> menus = base.QueryData(x => x.Enable == 1 || x.Enable == 2).OrderByDescending(a => a.OrderNo).ThenByDescending(q => q.ParentId).ToList(); + + List<MenuDTO> _menus = _mapper.Map<List<MenuDTO>>(menus); + + _menus.ForEach(x => + { + x.MenuType ??= 0; + if (!string.IsNullOrEmpty(x.Auth) && x.Auth.Length > 10) + { + try + { + x.Actions = x.Auth.DeserializeObject<List<ActionDTO>>(); + } + catch { } + } + x.Actions ??= new List<ActionDTO>(); + }); + string test = _menus.Serialize(); + return _menus; + } + + public object GetSuperAdminMenu() + { + return GetAllMenu().Select(x => + new + { + id = x.MenuId, + name = x.MenuName, + url = x.Url, + parentId = x.ParentId, + icon = x.Icon, + x.Enable, + x.TableName, // 2022.03.26澧炵Щ鍔ㄧ鍔犺彍鍗曠被鍨� + permission = x.Actions.Select(s => s.Value).ToArray() + }).ToList(); + } + + public object GetMenuByRoleId(int roleId) + { + var menu = from a in GetPermissions(roleId) + join b in GetAllMenu() + on a.MenuId equals b.MenuId + orderby b.OrderNo descending + select new + { + id = a.MenuId, + name = b.MenuName, + url = b.Url, + parentId = b.ParentId, + icon = b.Icon, + b.Enable, + b.TableName, + permission = a.UserAuthArr + }; + return menu.ToList(); + } + + /// <summary> + /// 鑾峰彇瑙掕壊鏉冮檺鏃堕�氳繃瀹夊叏瀛楀吀閿佸畾鐨勮鑹瞚d + /// </summary> + private static ConcurrentDictionary<string, object> objKeyValue = new ConcurrentDictionary<string, object>(); + + public List<Permissions> GetPermissions(int roleId) + { + if (App.User.IsRoleIdSuperAdmin(roleId)) + { + //2020.12.27澧炲姞鑿滃崟鐣岄潰涓婁笉鏄剧ず锛屼絾鍙互鍒嗛厤鏉冮檺 + var permissions = QueryData(x => x.Enable == 1 || x.Enable == 2) + .Select(a => new Permissions + { + MenuId = a.MenuId, + ParentId = a.ParentId, + TableName = (a.TableName ?? "").ToLower(), + UserAuth = a.Auth, + MenuType = a.MenuType ?? 0 + }).ToList(); + return MenuActionToArray(permissions); + } + + //閿佸畾姣忎釜瑙掕壊锛岄�氳繃瀹夊叏瀛楀吀鍑忓皯閿佺矑搴︼紝鍚﹀垯澶氫釜鍚屾椂瑙掕壊鑾峰彇缂撳瓨浼氬鑷撮樆濉� + object objId = objKeyValue.GetOrAdd(roleId.ToString(), new object()); + //閿佸畾姣忎釜瑙掕壊 + lock (objId) + { + //娌℃湁redis/memory缂撳瓨瑙掕壊鐨勭増鏈彿鎴栦笌褰撳墠鏈嶅姟鍣ㄧ殑瑙掕壊鐗堟湰鍙蜂笉鍚屾椂锛屽埛鏂扮紦瀛� + + List<Permissions> _permissions = QueryTabs<Sys_Menu, Sys_RoleAuth, Permissions>((a, b) => new object[] { JoinType.Inner, a.MenuId == b.MenuId }, (a, b) => new Permissions { MenuId = a.MenuId, ParentId = a.ParentId, TableName = (a.TableName ?? "").ToLower(), MenuAuth = a.Auth, UserAuth = b.AuthValue ?? "", MenuType = a.MenuType ?? 0 }, (a, b) => b.RoleId == roleId, a => true); + + ActionToArray(_permissions); + + return _permissions; + } + } + + private List<Permissions> MenuActionToArray(List<Permissions> permissions) + { + permissions.ForEach(x => + { + try + { + x.UserAuthArr = string.IsNullOrEmpty(x.UserAuth) + ? new string[0] + : x.UserAuth.DeserializeObject<List<ActionDTO>>().Select(s => s.Value).ToArray(); + } + catch { } + finally + { + if (x.UserAuthArr == null) + { + x.UserAuthArr = new string[0]; + } + } + }); + return permissions; + } + + private List<Permissions> ActionToArray(List<Permissions> permissions) + { + permissions.ForEach(x => + { + try + { + var menuAuthArr = x.MenuAuth.DeserializeObject<List<ActionDTO>>(); + x.UserAuthArr = string.IsNullOrEmpty(x.UserAuth) + ? new string[0] + : x.UserAuth.Split(",").Where(c => menuAuthArr.Any(m => m.Value == c)).ToArray(); + + } + catch { } + finally + { + if (x.UserAuthArr == null) + { + x.UserAuthArr = new string[0]; + } + } + }); + return permissions; + } + + public object GetMenu(List<int> menuIds) + { + return QueryData(x => menuIds.Contains(x.MenuId)).Select(a => + new + { + id = a.MenuId, + parentId = a.ParentId, + name = a.MenuName, + a.MenuType, + a.OrderNo + }).OrderByDescending(a => a.OrderNo) + .ThenByDescending(q => q.parentId).ToList(); + } + + public object GetTreeItem(int menuId) + { + var sysMenu = base.QueryData(x => x.MenuId == menuId) + .Select( + p => new + { + p.MenuId, + p.ParentId, + p.MenuName, + p.Url, + p.Auth, + p.OrderNo, + p.Icon, + p.Enable, + // 2022.03.26澧炵Щ鍔ㄧ鍔犺彍鍗曠被鍨� + MenuType = p.MenuType ?? 0, + p.CreateDate, + p.Creater, + p.TableName, + p.ModifyDate + }).FirstOrDefault(); + return sysMenu; + } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Repository/Sys_RoleAuthRepository.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Repository/Sys_RoleAuthRepository.cs" new file mode 100644 index 0000000..e61495b --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Repository/Sys_RoleAuthRepository.cs" @@ -0,0 +1,18 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Core.BaseRepository; +using WIDESEA_IRepository; +using WIDESEA_Model.Models; + +namespace WIDESEA_Repository +{ + internal class Sys_RoleAuthRepository : RepositoryBase<Sys_RoleAuth>, ISys_RoleAuthRepository + { + public Sys_RoleAuthRepository(IUnitOfWorkManage unitOfWorkManage) : base(unitOfWorkManage) + { + } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Repository/Sys_RoleRepository.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Repository/Sys_RoleRepository.cs" new file mode 100644 index 0000000..2b0da40 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Repository/Sys_RoleRepository.cs" @@ -0,0 +1,18 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Core.BaseRepository; +using WIDESEA_IRepository; +using WIDESEA_Model.Models; + +namespace WIDESEA_Repository +{ + public class Sys_RoleRepository : RepositoryBase<Sys_Role>, ISys_RoleRepository + { + public Sys_RoleRepository(IUnitOfWorkManage unitOfWorkManage) : base(unitOfWorkManage) + { + } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Repository/Sys_TenantRepository.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Repository/Sys_TenantRepository.cs" new file mode 100644 index 0000000..b213f56 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Repository/Sys_TenantRepository.cs" @@ -0,0 +1,18 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Core.BaseRepository; +using WIDESEA_IRepository; +using WIDESEA_Model.Models; + +namespace WIDESEA_Repository +{ + public class Sys_TenantRepository : RepositoryBase<Sys_Tenant>, ISys_TenantRepository + { + public Sys_TenantRepository(IUnitOfWorkManage unitOfWorkManage) : base(unitOfWorkManage) + { + } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Repository/Sys_TestRepository.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Repository/Sys_TestRepository.cs" new file mode 100644 index 0000000..f331eeb --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Repository/Sys_TestRepository.cs" @@ -0,0 +1,18 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Core.BaseRepository; +using WIDESEA_IRepository; +using WIDESEA_Model.Models; + +namespace WIDESEA_Repository +{ + internal class Sys_TestRepository : RepositoryBase<Sys_Test>, ISys_TestRepository + { + public Sys_TestRepository(IUnitOfWorkManage unitOfWorkManage) : base(unitOfWorkManage) + { + } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Repository/Sys_UserRepository.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Repository/Sys_UserRepository.cs" new file mode 100644 index 0000000..d601902 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Repository/Sys_UserRepository.cs" @@ -0,0 +1,26 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Core.BaseRepository; +using WIDESEA_Core.HttpContextUser; +using WIDESEA_IRepository; +using WIDESEA_Model; +using WIDESEA_Model.Models; + +namespace WIDESEA_Repository +{ + public class Sys_UserRepository : RepositoryBase<Sys_User>, ISys_UserRepository + { + public Sys_UserRepository(IUnitOfWorkManage unitOfWorkManage) : base(unitOfWorkManage) + { + + } + + public UserInfo GetUserInfo(string userName, string password) + { + return QueryFirst(x => x.UserName == userName && x.UserPwd == password, x => new UserInfo { HeadImageUrl = x.HeadImageUrl, RoleId = x.Role_Id, SystemType = x.SystemType, TenantId = x.TenantId, UserId = x.User_Id, UserName = x.UserName, UserTrueName = x.UserTrueName }); + } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Services/Sys_CompanyRegistrationService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Services/Sys_CompanyRegistrationService.cs" new file mode 100644 index 0000000..ba6272e --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Services/Sys_CompanyRegistrationService.cs" @@ -0,0 +1,161 @@ +锘縰sing AutoMapper; +using MailKit.Net.Smtp; +using Microsoft.AspNetCore.Components.Forms; +using MimeKit; +using OfficeOpenXml.FormulaParsing.Excel.Functions.Text; +using System.Net; +using System.Reflection; +using WIDESEA_Core; +using WIDESEA_Core.Authorization; +using WIDESEA_Core.BaseRepository; +using WIDESEA_Core.BaseServices; +using WIDESEA_Core.Const; +using WIDESEA_Core.Helper; +using WIDESEA_Core.HttpContextUser; +using WIDESEA_DTO.System; +using WIDESEA_IRepository; +using WIDESEA_IServices; +using WIDESEA_Model; +using WIDESEA_Model.Models; + +namespace WIDESEA_Services +{ + public class Sys_CompanyRegistrationService : ServiceBase<Sys_CompanyRegistration, ISys_CompanyRegistrationRepository>, ISys_CompanyRegistrationService + { + private readonly IUnitOfWorkManage _unitOfWorkManage; + private readonly IMapper _mapper; + private readonly ISys_ConfigService _configService; + + public Sys_CompanyRegistrationService(ISys_CompanyRegistrationRepository repository, + IUnitOfWorkManage unitOfWorkManage, + IMapper mapper, + ISys_ConfigService configService) : base(repository) + { + _unitOfWorkManage = unitOfWorkManage; + _mapper = mapper; + _configService = configService; + } + + public WebResponseContent RegisterCompany(RegistrationDTO registrationDto) + { + WebResponseContent content = new WebResponseContent(); + var invalidFields = new List<string>(); + + var properties = typeof(RegistrationDTO).GetProperties(); + foreach (var property in properties) + { + var value = property.GetValue(registrationDto); + // 妫�鏌ュ瓧娈靛�兼槸鍚︿负绌� + if ((value == null || string.IsNullOrWhiteSpace(value.ToString()))) + { + // 灏嗙┖瀛楁鍚嶇О娣诲姞鍒� invalidFields 闆嗗悎涓� + invalidFields.Add(property.Name); + } + } + Sys_CompanyRegistration registration = _mapper.Map<Sys_CompanyRegistration>(registrationDto); + // 濡傛灉瀛樺湪绌哄瓧娈碉紝鍒欒繑鍥為敊璇秷鎭� + if (invalidFields.Any()) + { + string invalidFieldsMessage = string.Join(", ", invalidFields); + return content.Error($"浠ヤ笅瀛楁涓嶈兘涓虹┖: {invalidFieldsMessage}"); + } + + var isResult = base.Db.Queryable<Sys_CompanyRegistration>().Any(x => x.CompanyName == registrationDto.CompanyName); + if (isResult) + { + return content.Error("宸叉彁浜ゆ敞鍐岋紝璇峰嬁閲嶅鎻愪氦"); + } + + List<Sys_Config> sysConfigs = _configService.GetConfigsByCategory(CateGoryConst.CONFIG_SYS_RegExmail); + if (sysConfigs == null) + { + return content.Error("灏氭湭閰嶇疆閭鏈嶅姟锛岃鑱旂郴绠$悊鍛橀厤缃偖绠辫浆鍙�"); + } + + // 璁剧疆榛樿鍊� + registration.RegistrationStatus = "寰呭鏍�"; + registration.Creater = "Systeam"; + + // 鍒涘缓 HTML 鏍煎紡鐨勯偖浠跺唴瀹� + var bodyBuilder = new BodyBuilder(); + bodyBuilder.HtmlBody = $@" + <html> + <body> + <h1>鏂扮敤鎴锋敞鍐岄�氱煡</h1> + <h2>鍏徃璇︽儏</h2> + <p><strong>鍏徃鍚嶇О:</strong> {registration.CompanyName}</p> + <p><strong>鍏徃绫诲瀷:</strong> {registration.CompanyType}</p> + <p><strong>琛屼笟绫诲埆:</strong> {registration.Industry}</p> + <h2>鑱旂郴浜烘槑缁�</h2> + <p><strong>鑱旂郴浜哄鍚�:</strong> {registration.ContactName}</p> + <p><strong>鑱旂郴浜虹數璇�:</strong> {registration.ContactPhone}</p> + <p><strong>鑱旂郴浜虹數瀛愰偖绠�:</strong> {registration.ContactEmail}</p> + <h2>闅愮鏀跨瓥</h2> + <p><strong>浣跨敤鏉℃鍜岄殣绉佹斂绛�:</strong> {(registration.AgreeTerms ? "鍚屾剰" : "涓嶅悓鎰�")}</p> + <br/> + <br/> + <p>鍙戜欢浜�,<br/>婀栧崡瀹芥捣鏅鸿兘</p> + </body> + </html>"; + //"chenmeimei@hnkhzn.com" + isResult = SendEmail(sysConfigs, registrationDto, bodyBuilder); + // 淇濆瓨鍒版暟鎹簱 + BaseDal.AddData(registration); + return content.OK(); + } + + /// <summary> + /// 鍙戦�侀偖绠� + /// </summary> + /// <param name="configs"></param> + /// <param name="registration"></param> + /// <returns></returns> + public bool SendEmail(List<Sys_Config> configs, RegistrationDTO registration, BodyBuilder bodyBuilder) + { + List<Sys_Config> sysConfigs = _configService.GetConfigsByCategory(CateGoryConst.CONFIG_SYS_BaseExmail); + if (sysConfigs == null) + { + return false; + } + + // 鑾峰彇 smtp 閰嶇疆 + string _smtpServer = sysConfigs.FirstOrDefault(x => x.ConfigKey == SysConfigConst.SMTP_Server).ConfigValue ?? ""; + int _smtpPort = sysConfigs.FirstOrDefault(x => x.ConfigKey == SysConfigConst.SMTP_Port).ConfigValue.ObjToInt(); + string _smtpUser = sysConfigs.FirstOrDefault(x => x.ConfigKey == SysConfigConst.SMTP_User).ConfigValue ?? ""; + string _smtpPass = sysConfigs.FirstOrDefault(x => x.ConfigKey == SysConfigConst.SMTP_Pass).ConfigValue ?? ""; + + // 鑾峰彇 閭欢閰嶇疆 + string _smtpTitle = configs.FirstOrDefault(x => x.ConfigKey == SysConfigConst.SMTP_Title).ConfigValue ?? ""; + string _smtpConTitle = configs.FirstOrDefault(x => x.ConfigKey == SysConfigConst.SMTP_ContentTitle).ConfigValue ?? ""; + string _smtpRegUser = configs.FirstOrDefault(x => x.ConfigKey == SysConfigConst.SMTP_RegUser).ConfigValue ?? ""; + + // 鍒涘缓閭欢 + var message = new MimeMessage(); + message.From.Add(new MailboxAddress(_smtpTitle, _smtpUser)); + message.To.Add(new MailboxAddress("", _smtpRegUser)); + message.Subject = _smtpConTitle; + + message.Body = bodyBuilder.ToMessageBody(); + + // 鍙戦�侀偖浠� + try + { + using (var client = new SmtpClient()) + { + client.Connect(_smtpServer, _smtpPort, true); + client.Authenticate(_smtpUser, _smtpPass); + client.Send(message); + client.Disconnect(true); + } + + Console.WriteLine("閭欢鍙戦�佹垚鍔燂紒"); + return true; + } + catch (Exception ex) + { + Console.WriteLine($"鍙戦�侀偖浠舵椂鍙戠敓鏈煡閿欒锛歿ex.Message}"); + return false; + } + } + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Services/Sys_ConfigService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Services/Sys_ConfigService.cs" new file mode 100644 index 0000000..689d19e --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Services/Sys_ConfigService.cs" @@ -0,0 +1,43 @@ +锘縰sing WIDESEA_Core.Authorization; +using WIDESEA_Core; +using WIDESEA_Core.BaseServices; +using WIDESEA_Core.Const; +using WIDESEA_Core.Helper; +using WIDESEA_Core.HttpContextUser; +using WIDESEA_IServices; +using WIDESEA_Model; +using WIDESEA_Model.Models; +using WIDESEA_IRepository; +using WIDESEA_Core.BaseRepository; +using System.Net; + +namespace WIDESEA_Services +{ + public class Sys_ConfigService : ServiceBase<Sys_Config, ISys_ConfigRepository>, ISys_ConfigService + { + private readonly IUnitOfWorkManage _unitOfWorkManage; + + public Sys_ConfigService(ISys_ConfigRepository repository, IUnitOfWorkManage unitOfWorkManage) : base(repository) + { + _unitOfWorkManage = unitOfWorkManage; + } + + /// <inheritdoc/> + public List<Sys_Config> GetAll() + { + return BaseDal.QueryData(); + } + + /// <inheritdoc/> + public List<Sys_Config> GetConfigsByCategory(string category) + { + return BaseDal.QueryData(x => x.Category == category).ToList(); + } + + /// <inheritdoc/> + public Sys_Config GetByConfigKey(string category, string configKey) + { + return BaseDal.QueryData(x => x.Category == category && x.ConfigKey == configKey).FirstOrDefault(); + } + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Services/Sys_DictionaryService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Services/Sys_DictionaryService.cs" new file mode 100644 index 0000000..621a3ec --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Services/Sys_DictionaryService.cs" @@ -0,0 +1,50 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Core.BaseRepository; +using WIDESEA_Core.BaseServices; +using WIDESEA_IRepository; +using WIDESEA_IServices; +using WIDESEA_Model.Models; + +namespace WIDESEA_Services +{ + public class Sys_DictionaryService : ServiceBase<Sys_Dictionary, ISys_DictionaryRepository>, ISys_DictionaryService + { + private readonly IUnitOfWorkManage _unitOfWorkManage; + public Sys_DictionaryService(ISys_DictionaryRepository BaseDal, IUnitOfWorkManage unitOfWorkManage) : base(BaseDal) + { + _unitOfWorkManage = unitOfWorkManage; + } + + public object GetVueDictionary(string[] dicNos) + { + if (dicNos == null || dicNos.Count() == 0) return new string[] { }; + + var dicConfig = BaseDal.GetDictionaries(dicNos, false).Select(s => new + { + dicNo = s.DicNo, + config = s.Config, + dbSql = s.DBSql, + list = s.DicList.OrderByDescending(o => o.OrderNo).Select(list => new { key = list.DicValue, value = list.DicName }) + }).ToList(); + + object GetSourceData(string dicNo, string dbSql, object data) + { + if (string.IsNullOrEmpty(dbSql)) + { + return data as object; + } + return BaseDal.QueryObjectDataBySql(dbSql, null); + } + return dicConfig.Select(item => new + { + item.dicNo, + item.config, + data = GetSourceData(item.dicNo, item.dbSql, item.list) + }).ToList(); + } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Services/Sys_MenuService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Services/Sys_MenuService.cs" new file mode 100644 index 0000000..6265c26 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Services/Sys_MenuService.cs" @@ -0,0 +1,207 @@ +锘縰sing SqlSugar; +using System; +using System.Collections.Concurrent; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Core; +using WIDESEA_Core.BaseRepository; +using WIDESEA_Core.BaseServices; +using WIDESEA_Core.Helper; +using WIDESEA_DTO.System; +using WIDESEA_IRepository; +using WIDESEA_IServices; +using WIDESEA_Model; +using WIDESEA_Model.Models; + +namespace WIDESEA_Services +{ + public class Sys_MenuService : ServiceBase<Sys_Menu, ISys_MenuRepository>, ISys_MenuService + { + private readonly IUnitOfWorkManage _unitOfWorkManage; + + public Sys_MenuService(ISys_MenuRepository BaseDal, IUnitOfWorkManage unitOfWorkManage) : base(BaseDal) + { + _unitOfWorkManage = unitOfWorkManage; + } + + /// <summary> + /// 鑾峰彇褰撳墠鐢ㄦ埛鎵�鏈夎彍鍗曚笌鏉冮檺 + /// </summary> + /// <returns></returns> + public object GetCurrentMenuActionList() + { + object obj = GetMenuActionList(App.User.RoleId); + if (obj is IEnumerable<object> list) + { + if (list.Any()) + { + return obj; + } + else + { + return WebResponseContent.Instance.Error("鏈幏鍙栧埌鑿滃崟淇℃伅"); + } + } + return obj; + } + + public object GetCurrentMenuPhoneActionList() + { + object obj = GetMenuActionPhoneList(App.User.RoleId); + if (obj is IEnumerable<object> list) + { + if (list.Any()) + { + return obj; + } + else + { + return WebResponseContent.Instance.Error("鏈幏鍙栧埌鑿滃崟淇℃伅"); + } + } + return obj; + } + + /// <summary> + /// 鏍规嵁瑙掕壊ID鑾峰彇鑿滃崟涓庢潈闄� + /// </summary> + /// <param name="roleId"></param> + /// <returns></returns> + public object GetMenuActionList(int roleId) + { + return BaseDal.GetMenuByRoleId(roleId); + } + + /// <summary> + /// 鏍规嵁瑙掕壊ID鑾峰彇鑿滃崟涓庢潈闄� + /// </summary> + /// <param name="roleId"></param> + /// <returns></returns> + public object GetMenuActionPhoneList(int roleId) + { + var allMenu = BaseDal.QueryData(x => (x.Enable == 1 || x.Enable == 2) && x.MenuType == 1 && x.ParentId > 0).OrderByDescending(a => a.OrderNo).ThenByDescending(q => q.ParentId).ToList(); + + var menu = allMenu.Select(x => new + { + text = x.MenuName, + url = x.Url, + icon = x.Icon, + }); + return menu.ToList(); + } + + public List<MenuDTO> GetUserMenuList(int roleId) + { + if (App.User.IsRoleIdSuperAdmin(roleId)) + { + return BaseDal.GetAllMenu(); + } + List<int> menuIds = BaseDal.GetPermissions(roleId).Select(x => x.MenuId).ToList(); + return BaseDal.GetAllMenu().Where(x => menuIds.Contains(x.MenuId)).ToList(); + } + + public List<ActionDTO> GetActions(int menuId, List<ActionDTO> menuActions, List<Permissions> permissions, int roleId) + { + if (App.User.IsRoleIdSuperAdmin(roleId)) + { + return menuActions; + } + + return menuActions.Where(p => permissions + .Exists(w => menuId == w.MenuId + && w.UserAuthArr.Contains(p.Value))) + .ToList(); + } + + /// <summary> + /// 缂栬緫淇敼鑿滃崟鏃�,鑾峰彇鎵�鏈夎彍鍗� + /// </summary> + /// <returns></returns> + public object GetMenu() + { + if (App.User.IsRoleIdSuperAdmin(App.User.RoleId)) + { + List<int> menuIds = BaseDal.QueryData().Select(x => x.MenuId).ToList(); + return BaseDal.GetMenu(menuIds); + } + else + { + List<int> menuIds = BaseDal.GetPermissions(App.User.RoleId).Select(x => x.MenuId).ToList(); + return BaseDal.GetMenu(menuIds); + } + } + + /// <summary> + /// 缂栬緫鑿滃崟鏃讹紝鑾峰彇鑿滃崟淇℃伅 + /// </summary> + /// <param name="menuId"></param> + /// <returns></returns> + public object GetTreeItem(int menuId) + { + return BaseDal.GetTreeItem(menuId); + } + + /// <summary> + /// 鏂板缓鎴栫紪杈戣彍鍗� + /// </summary> + /// <param name="menu"></param> + /// <returns></returns> + public WebResponseContent Save(Sys_Menu menu) + { + WebResponseContent webResponse = new WebResponseContent(); + if (menu == null) return webResponse.Error("娌℃湁鑾峰彇鍒版彁浜ょ殑鍙傛暟"); + if (menu.MenuId > 0 && menu.MenuId == menu.ParentId) return webResponse.Error("鐖剁骇ID涓嶈兘鏄綋鍓嶈彍鍗曠殑ID"); + try + { + //webResponse = menu.ValidationEntity(x => new { x.MenuName, x.TableName }); + //if (!webResponse.Status) return webResponse; + if (menu.TableName != "/" && menu.TableName != ".") + { + // 2022.03.26澧炵Щ鍔ㄧ鍔犺彍鍗曠被鍨嬪垽鏂� + Sys_Menu sysMenu = BaseDal.QueryFirst(x => x.TableName == menu.TableName); + if (sysMenu != null) + { + sysMenu.MenuType ??= 0; + if (sysMenu.MenuType == menu.MenuType) + { + if ((menu.MenuId > 0 && sysMenu.MenuId != menu.MenuId) + || menu.MenuId <= 0) + { + return webResponse.Error($"瑙嗗浘/琛ㄥ悕銆恵menu.TableName}銆戝凡琚叾浠栬彍鍗曚娇鐢�"); + } + } + } + } + bool _changed = false; + if (menu.MenuId <= 0) + { + BaseDal.AddData(menu); + } + else + { + //2020.05.07鏂板绂佹閫夋嫨涓婄骇瑙掕壊涓鸿嚜宸� + if (menu.MenuId == menu.ParentId) + { + return webResponse.Error($"鐖剁骇id涓嶈兘涓鸿嚜宸�"); + } + if (BaseDal.QueryFirst(x => x.ParentId == menu.MenuId && menu.ParentId == x.MenuId) != null) + { + return webResponse.Error($"涓嶈兘閫夋嫨姝ょ埗绾d锛岄�夋嫨鐨勭埗绾d涓庡綋鍓嶈彍鍗曞舰鎴愪緷璧栧叧绯�"); + } + + _changed = BaseDal.QueryData(c => c.MenuId == menu.MenuId).Select(s => s.Auth).FirstOrDefault() != menu.Auth; + + BaseDal.UpdateData(menu); + } + webResponse.OK("淇濆瓨鎴愬姛", menu); + } + catch (Exception ex) + { + webResponse.Error(ex.Message); + } + return webResponse; + } + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Services/Sys_RoleService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Services/Sys_RoleService.cs" new file mode 100644 index 0000000..60bad17 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Services/Sys_RoleService.cs" @@ -0,0 +1,217 @@ +锘縰sing AutoMapper; +using Microsoft.AspNetCore.DataProtection.KeyManagement; +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Core; +using WIDESEA_Core.BaseRepository; +using WIDESEA_Core.BaseServices; +using WIDESEA_Core.HttpContextUser; +using WIDESEA_DTO.System; +using WIDESEA_IRepository; +using WIDESEA_IServices; +using WIDESEA_Model.Models; +using WIDESEA_Model.Models.System; +using WIDESEA_Repository; + +namespace WIDESEA_Services +{ + public class Sys_RoleService : ServiceBase<Sys_Role, ISys_RoleRepository>, ISys_RoleService + { + private readonly IUnitOfWorkManage _unitOfWorkManage; + private readonly ISys_MenuRepository _MenuRepository; + private readonly ISys_MenuService _MenuService; + private readonly ISys_RoleAuthRepository _RoleAuthRepository; + private readonly IMapper _mapper; + public Sys_RoleService(ISys_RoleRepository BaseDal, ISys_MenuRepository MenuRepository, ISys_MenuService MenuService, ISys_RoleAuthRepository roleAuthRepository, IUnitOfWorkManage unitOfWorkManage, IMapper mapper) : base(BaseDal) + { + _unitOfWorkManage = unitOfWorkManage; + _MenuRepository = MenuRepository; + _MenuService = MenuService; + _RoleAuthRepository = roleAuthRepository; + _mapper = mapper; + } + + public List<RoleNodes> GetAllChildren(int roleId) + { + if (roleId <= 0) return new List<RoleNodes>() { }; + var roles = GetAllRoleId(); + if (App.User.IsRoleIdSuperAdmin(roleId)) return roles; + + var list = GetChildren(roles, roleId); + return list; + } + + public List<RoleNodes> GetAllRoleId() + { + List<RoleNodes> roles = BaseDal.QueryData().Select(s => new RoleNodes() { Id = s.RoleId, ParentId = s.ParentId, RoleName = s.RoleName }).ToList(); + + return roles; + } + + /// <summary> + /// 鑾峰彇鎵�鏈夊瓙鑺傜偣 + /// </summary> + /// <param name="roleId"></param> + private List<RoleNodes> GetChildren(List<RoleNodes> roles, int roleId) + { + List<RoleNodes> rolesChildren = roles.Where(x => x.Id == roleId).Distinct().ToList(); + + for (int i = 0; i < rolesChildren.Count; i++) + { + RoleNodes node = rolesChildren[i]; + var children = roles.Where(x => x.ParentId == node.Id && !rolesChildren.Any(c => c.Id == x.Id)).Distinct().ToList(); + rolesChildren.AddRange(children); + } + return rolesChildren; + } + + /// <summary> + /// 缂栬緫鏉冮檺鏃惰幏鍙栧綋鍓嶇敤鎴蜂笅鐨勬墍鏈夎鑹蹭笌褰撳墠鐢ㄦ埛鐨勮彍鍗曟潈闄� + /// </summary> + /// <returns></returns> + public WebResponseContent GetCurrentTreePermission() + { + WebResponseContent content = GetCurrentUserTreePermission(); + int roleId = App.User.RoleId; + return WebResponseContent.Instance.OK(null, new + { + tree = content.Data, + roles = GetAllChildren(roleId) + }); + } + + /// <summary> + /// 缂栬緫鏉冮檺鏃讹紝鑾峰彇褰撳墠鐢ㄦ埛鐨勬墍鏈夎彍鍗曟潈闄� + /// </summary> + /// <returns></returns> + public WebResponseContent GetCurrentUserTreePermission() + { + return GetUserTreePermission(App.User.RoleId); + } + + /// <summary> + /// 缂栬緫鏉冮檺鏃讹紝鑾峰彇鎸囧畾瑙掕壊鐨勬墍鏈夎彍鍗曟潈闄� + /// </summary> + /// <param name="roleId"></param> + /// <returns></returns> + public WebResponseContent GetUserTreePermission(int roleId) + { + if (!App.User.IsRoleIdSuperAdmin(roleId) && App.User.RoleId != roleId) + { + if (!GetAllChildren(App.User.RoleId).Exists(x => x.Id == roleId)) + { + return WebResponseContent.Instance.Error("娌℃湁鏉冮檺鑾峰彇姝よ鑹茬殑鏉冮檺淇℃伅"); + } + } + //鑾峰彇鐢ㄦ埛鏉冮檺 + List<Permissions> permissions = _MenuRepository.GetPermissions(roleId); + //鏉冮檺鐢ㄦ埛鏉冮檺鏌ヨ鎵�鏈夌殑鑿滃崟淇℃伅 + List<MenuDTO> menus = _MenuService.GetUserMenuList(roleId); + //鑾峰彇褰撳墠鐢ㄦ埛鏉冮檺濡�:(Add,Search)瀵瑰簲鐨勬樉绀烘枃鏈俊鎭:Add锛氭坊鍔狅紝Search:鏌ヨ + var data = menus.Select(x => new + { + Id = x.MenuId, + Pid = x.ParentId, + Text = x.MenuName, + IsApp = x.MenuType == 1, + Actions = _MenuService.GetActions(x.MenuId, x.Actions, permissions, roleId) + }); + return WebResponseContent.Instance.OK(null, data); + } + + /// <summary> + /// 淇濆瓨瑙掕壊鏉冮檺 + /// </summary> + /// <param name="userPermissions"></param> + /// <param name="roleId"></param> + /// <returns></returns> + public WebResponseContent SavePermission(List<UserPermissionDTO> userPermissions, int roleId) + { + WebResponseContent content = new WebResponseContent(); + string message = ""; + try + { + UserInfo user = App.User.GetCurrentUserInfo(); + if (!GetAllChildren(user.RoleId).Exists(x => x.Id == roleId)) + return WebResponseContent.Instance.Error("娌℃湁鏉冮檺淇敼姝よ鑹茬殑鏉冮檺淇℃伅"); + //褰撳墠鐢ㄦ埛鐨勬潈闄� + List<Permissions> permissions = _MenuRepository.GetPermissions(App.User.RoleId); + + List<int> originalMeunIds = new List<int>(); + //琚垎閰嶈鑹茬殑鏉冮檺 + List<Sys_RoleAuth> roleAuths = _RoleAuthRepository.QueryData(x => x.RoleId == roleId); + List<Sys_RoleAuth> updateAuths = new List<Sys_RoleAuth>(); + foreach (UserPermissionDTO x in userPermissions) + { + Permissions per = permissions.Where(p => p.MenuId == x.Id).FirstOrDefault(); + //涓嶈兘鍒嗛厤瓒呰繃褰撳墠鐢ㄦ埛鐨勬潈闄� + if (per == null) continue; + //per.UserAuthArr.Contains(a.Value)鏍¢獙鏉冮檺鑼冨洿 + string[] arr = x.Actions == null || x.Actions.Count == 0 + ? new string[0] + : x.Actions.Where(a => per.UserAuthArr.Contains(a.Value)) + .Select(s => s.Value).ToArray(); + + //濡傛灉褰撳墠鏉冮檺娌℃湁鍒嗛厤杩囷紝璁剧疆Auth_Id榛樿涓�0锛岃〃绀烘柊澧炵殑鏉冮檺 + var auth = roleAuths.Where(r => r.MenuId == x.Id).Select(s => new { s.AuthId, s.AuthValue, s.MenuId }).FirstOrDefault(); + string newAuthValue = string.Join(",", arr); + //鏉冮檺娌℃湁鍙戠敓鍙樺寲鍒欎笉澶勭悊 + if (auth == null || auth.AuthValue != newAuthValue) + { + updateAuths.Add(new Sys_RoleAuth() + { + RoleId = roleId, + MenuId = x.Id, + AuthValue = string.Join(",", arr), + AuthId = auth == null ? 0 : auth.AuthId, + ModifyDate = DateTime.Now, + Modifier = user.UserName, + CreateDate = DateTime.Now, + Creater = user.UserName + }); + } + else + { + originalMeunIds.Add(auth.MenuId); + } + + } + //鏇存柊鏉冮檺 + _RoleAuthRepository.UpdateData(updateAuths); + //鏂板鐨勬潈闄� + _RoleAuthRepository.AddData(updateAuths); + + //鑾峰彇鏉冮檺鍙栨秷鐨勬潈闄� + int[] authIds = roleAuths.Where(x => userPermissions.Select(u => u.Id) + .ToList().Contains(x.MenuId) || originalMeunIds.Contains(x.MenuId)) + .Select(s => s.AuthId) + .ToArray(); + List<Sys_RoleAuth> delAuths = roleAuths.Where(x => x.AuthValue != "" && !authIds.Contains(x.AuthId)).ToList(); + delAuths.ForEach(x => + { + x.AuthValue = ""; + }); + //灏嗗彇娑堢殑鏉冮檺璁剧疆涓�"" + _RoleAuthRepository.UpdateData(delAuths); + + int addCount = updateAuths.Where(x => x.AuthId <= 0).Count(); + int updateCount = updateAuths.Where(x => x.AuthId > 0).Count(); + + string _version = DateTime.Now.ToString("yyyyMMddHHMMssfff"); + + + content.OK($"淇濆瓨鎴愬姛锛氭柊澧炲姞閰嶈彍鍗曟潈闄恵addCount}鏉�,鏇存柊鑿滃崟{updateCount}鏉�,鍒犻櫎鏉冮檺{delAuths.Count()}鏉�"); + } + catch (Exception ex) + { + message = "寮傚父淇℃伅锛�" + ex.Message + ex.StackTrace + ","; + } + + return content; + } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Services/Sys_TenantService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Services/Sys_TenantService.cs" new file mode 100644 index 0000000..f6bf57a --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Services/Sys_TenantService.cs" @@ -0,0 +1,80 @@ +锘縰sing SqlSugar; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Core; +using WIDESEA_Core.AOP; +using WIDESEA_Core.BaseRepository; +using WIDESEA_Core.BaseServices; +using WIDESEA_Core.Const; +using WIDESEA_Core.Helper; +using WIDESEA_Core.Seed; +using WIDESEA_IRepository; +using WIDESEA_IServices; +using WIDESEA_Model.Models; + +namespace WIDESEA_Services +{ + public class Sys_TenantService : ServiceBase<Sys_Tenant, ISys_TenantRepository>, ISys_TenantService + { + private IUnitOfWorkManage _unitOfWorkManage; + public Sys_TenantService(ISys_TenantRepository BaseDal, IUnitOfWorkManage unitOfWorkManage) : base(BaseDal) + { + _unitOfWorkManage = unitOfWorkManage; + } + + public WebResponseContent InitTenantInfo(string tenantName, int tenantType) + { + WebResponseContent content = new WebResponseContent(); + try + { + Sys_Tenant tenant = new Sys_Tenant() + { + ConnectionString = TenantConst.DBConStr, + DbType = 1, + Status = 1, + TenantName = tenantName, + TenantType = tenantType, + CreateDate = DateTime.Now, + Creater = "1111" + }; + + int tenantId = BaseDal.Db.Insertable(tenant).ExecuteReturnIdentity(); + + tenant = BaseDal.QueryFirst(x => x.TenantId == tenantId); + + tenant.ConnectionString = string.Format(TenantConst.DBConStr, ".", "Tenant_WMSDB_" + tenantId, "sa", "P@ssw0rd").EncryptDES(AppSecret.DB); + + BaseDal.UpdateData(tenant); + + InitTenantDb(tenant); + content = WebResponseContent.Instance.OK(); + } + catch (Exception ex) + { + content = WebResponseContent.Instance.Error(ex.Message); + } + return content; + } + + public void InitTenantDb(Sys_Tenant tenant) + { + string conStr = tenant.ConnectionString.DecryptDES(AppSecret.DB); + + ConnectionConfig connectionConfig = new ConnectionConfig() + { + ConfigId = tenant.TenantId, + ConnectionString = conStr, + DbType = (DbType)tenant.DbType, + IsAutoCloseConnection = true, + AopEvents = new AopEvents() + { + DataExecuting = SqlSugarAop.DataExecuting + } + }; + DBSeed.InitTenantSeedAsync(Db.AsTenant(), connectionConfig); + } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Services/Sys_TestService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Services/Sys_TestService.cs" new file mode 100644 index 0000000..408ea58 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Services/Sys_TestService.cs" @@ -0,0 +1,36 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Core; +using WIDESEA_Core.BaseRepository; +using WIDESEA_Core.BaseServices; +using WIDESEA_IRepository; +using WIDESEA_IServices; +using WIDESEA_Model.Models; + +namespace WIDESEA_Services +{ + public class Sys_TestService : ServiceBase<Sys_Test, ISys_TestRepository>, ISys_TestService + { + private readonly IUnitOfWorkManage _unitOfWorkManage; + public Sys_TestService(ISys_TestRepository BaseDal, IUnitOfWorkManage unitOfWorkManage) : base(BaseDal) + { + _unitOfWorkManage = unitOfWorkManage; + } + + public WebResponseContent TranTest() + { + Sys_Test sys_Test = BaseDal.QueryFirst(x => true); + sys_Test.TestContent = "TranTest"; + _unitOfWorkManage.BeginTran(); + + BaseDal.UpdateData(sys_Test); + + _unitOfWorkManage.CommitTran(); + + return WebResponseContent.Instance.OK(); + } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Services/Sys_UserService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Services/Sys_UserService.cs" new file mode 100644 index 0000000..3e54bc3 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Services/Sys_UserService.cs" @@ -0,0 +1,216 @@ +锘縰sing WIDESEA_Core.Authorization; +using WIDESEA_Core; +using WIDESEA_Core.BaseServices; +using WIDESEA_Core.Const; +using WIDESEA_Core.Helper; +using WIDESEA_Core.HttpContextUser; +using WIDESEA_IServices; +using WIDESEA_Model; +using WIDESEA_Model.Models; +using WIDESEA_IRepository; +using WIDESEA_Core.BaseRepository; +using System.Net; +using WIDESEA_Repository; + +namespace WIDESEA_Services +{ + public class Sys_UserService : ServiceBase<Sys_User, ISys_UserRepository>, ISys_UserService + { + private readonly IUnitOfWorkManage _unitOfWorkManage; + public Sys_UserService(ISys_UserRepository repository, IUnitOfWorkManage unitOfWorkManage) : base(repository) + { + _unitOfWorkManage = unitOfWorkManage; + } + + public WebResponseContent Login(LoginInfo loginInfo) + { + WebResponseContent content = new WebResponseContent(); + try + { + //BaseDal.QueryFirst(x => x.UserName == loginInfo.UserName); + + string msg = string.Empty; + + #region 涓存椂浣跨敤 + try + { + loginInfo.Password = loginInfo.Password.EncryptDES(AppSecret.User); + } + catch + { + + } + #endregion + + UserInfo user = BaseDal.GetUserInfo(loginInfo.UserName, loginInfo.Password); + if (user != null) + { + string token = JwtHelper.IssueJwt(new TokenModelJwt() + { + UserId = user.UserId, + RoleId = user.RoleId, + }); + + content = WebResponseContent.Instance.OK(data: new { token, userName = user.UserTrueName, img = user.HeadImageUrl }); + } + else + { + content = WebResponseContent.Instance.Error("璐﹀彿鎴栧瘑鐮侀敊璇�"); + } + } + catch (Exception ex) + { + content = WebResponseContent.Instance.Error(ex.Message); + } + + return content; + } + + public override WebResponseContent UpdateData(SaveModel saveModel) + { + UpdateIgnoreColOnExecute = x => + { + return new List<string> + { + nameof(Sys_User.UserPwd), + nameof(Sys_User.SystemType), + nameof(Sys_User.TenantId) + }; + }; + return base.UpdateData(saveModel); + } + + public override WebResponseContent AddData(SaveModel saveModel) + { + string pwd = "123456"; + string uesrName = saveModel.MainData[nameof(Sys_User.UserName).FirstLetterToLower()].ToString(); + saveModel.MainData[nameof(Sys_User.UserPwd).FirstLetterToLower()] = pwd.EncryptDES(AppSecret.User); + + WebResponseContent content = base.AddData(saveModel); + if (content.Status) + { + return WebResponseContent.Instance.OK($"鐢ㄦ埛鏂板缓鎴愬姛.甯愬彿{uesrName}瀵嗙爜{pwd}"); + } + else + { + return content; + } + } + + /// <summary> + /// 涓汉涓績鑾峰彇褰撳墠鐢ㄦ埛淇℃伅 + /// </summary> + /// <returns></returns> + public WebResponseContent GetCurrentUserInfo() + { + var data = BaseDal.QueryFirst(x => x.User_Id == App.User.UserId, s => new + { + s.User_Id, + s.UserName, + s.UserTrueName, + s.Address, + s.PhoneNo, + s.Email, + s.Remark, + s.Gender, + s.RoleName, + s.HeadImageUrl, + s.CreateDate + }); + return WebResponseContent.Instance.OK(null, data); + } + + /// <summary> + /// 淇敼瀵嗙爜 + /// </summary> + /// <param name="parameters"></param> + /// <returns></returns> + public WebResponseContent ModifyPwd(string oldPwd, string newPwd) + { + WebResponseContent content = WebResponseContent.Instance; + oldPwd = oldPwd?.Trim(); + newPwd = newPwd?.Trim(); + string message = ""; + try + { + if (string.IsNullOrEmpty(oldPwd)) return WebResponseContent.Instance.Error("鏃у瘑鐮佷笉鑳戒负绌�"); + if (string.IsNullOrEmpty(newPwd)) return WebResponseContent.Instance.Error("鏂板瘑鐮佷笉鑳戒负绌�"); + if (newPwd.Length < 6) return WebResponseContent.Instance.Error("瀵嗙爜涓嶈兘灏戜簬6浣�"); + + int userId = App.User.UserId; + string userCurrentPwd = BaseDal.QueryFirst(x => x.User_Id == userId, s => s.UserPwd); + + string _oldPwd = oldPwd.EncryptDES(AppSecret.User); + if (_oldPwd != userCurrentPwd) return WebResponseContent.Instance.Error("鏃у瘑鐮佷笉姝g‘"); + + string _newPwd = newPwd.EncryptDES(AppSecret.User); + if (userCurrentPwd == _newPwd) return WebResponseContent.Instance.Error("鏂板瘑鐮佷笉鑳戒笌鏃у瘑鐮佺浉鍚�"); + + + BaseDal.UpdateData(new Sys_User + { + User_Id = userId, + UserPwd = _newPwd, + LastModifyPwdDate = DateTime.Now + }, new List<string> + { + nameof(Sys_User.LastModifyPwdDate), + nameof(Sys_User.UserPwd) + }); + + content = WebResponseContent.Instance.OK("瀵嗙爜淇敼鎴愬姛"); + } + catch (Exception ex) + { + message = ex.Message; + content = WebResponseContent.Instance.Error("鏈嶅姟鍣ㄤ簡鐐归棶棰�,璇风◢鍚庡啀璇�"); + } + return content; + } + + public WebResponseContent ModifyUserPwd(string password,string userName) + { + WebResponseContent webResponse = new WebResponseContent(); + if (string.IsNullOrEmpty(password) || string.IsNullOrEmpty(userName)) + { + return webResponse.Error("鍙傛暟涓嶅畬鏁�"); + } + if (password.Length < 6) return webResponse.Error("瀵嗙爜闀垮害涓嶈兘灏戜簬6浣�"); + + + Sys_User user = BaseDal.QueryFirst(x => x.UserName == userName); + if (user == null) + { + return webResponse.Error("鐢ㄦ埛涓嶅瓨鍦�"); + } + user.UserPwd = password.EncryptDES(AppSecret.User); + BaseDal.UpdateData(user); + //濡傛灉鐢ㄦ埛鍦ㄧ嚎锛屽己鍒朵笅绾� + //UserContext.Current.LogOut(user.User_Id); + return webResponse.OK("瀵嗙爜淇敼鎴愬姛"); + } + public WebResponseContent UpdateInfo(int user_Id, string roleName, string userName, string userTrueName, string address, int gender, string remark) + { + WebResponseContent content = new WebResponseContent(); + + var userInfo = BaseDal.QueryFirst(x => x.User_Id == user_Id); + if (userInfo != null) + { + userInfo.RoleName= roleName; + userInfo.UserName = userName; + userInfo.UserTrueName = userTrueName; + userInfo.Address = address; + userInfo.Gender = gender; + userInfo.Remark = remark; + userInfo.ModifyDate = DateTime.Now; + BaseDal.UpdateData(userInfo); + content = WebResponseContent.Instance.OK("涓汉淇℃伅淇敼鎴愬姛"); + } + else + { + content = WebResponseContent.Instance.Error("鏈嶅姟鍣ㄤ簡鐐归棶棰�,璇风◢鍚庡啀璇�"); + } + return content; + } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/AGV/Partial/UntieStation.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/AGV/Partial/UntieStation.cs" new file mode 100644 index 0000000..34a9a0f --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/AGV/Partial/UntieStation.cs" @@ -0,0 +1,59 @@ +锘縰sing Masuit.Tools; +using Microsoft.AspNetCore.Mvc.ViewFeatures; +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Comm; +using WIDESEA_Comm.AGVInterface.Requset; +using WIDESEA_Common; +using WIDESEA_Core; +using WIDESEA_Model.Models; + +namespace WIDESEA_StoragIntegrationServices +{ + public partial class ToAGVService + { + /// <summary> + /// + /// </summary> + /// <param name="taskinfo"></param> + /// <param name="operationType">鎿嶄綔绫诲瀷(1-缁戝畾 2-瑙g粦)</param> + /// <returns></returns> + public static WebResponseContent UntieStation(Dt_Task taskinfo, string operationType) + { + WebResponseContent content = new WebResponseContent(); + try + { + bindCtnrAndBin bind = new bindCtnrAndBin() + { + reqCode = Guid.NewGuid().ToString().Replace("-", ""), + clientCode = "WMS", + ctnrTyp = "2", + indBind = operationType, // 1-缁戝畾 2-瑙g粦 + stgBinCode = taskinfo.SourceAddress, + }; + + string ipaddress = AGV_Interface + "/getCLInfostring"; + + var requestBindInfo = bind.ToDictionary(); + + var strRespon = HttpsClient.PostAsync(ipaddress, requestBindInfo).Result; + + var responBase = JsonConvert.DeserializeObject<AGVResponBase>(strRespon); + if (responBase.code != "0") throw new Exception(responBase.message); + + //todo + + return content.OK(); + } + catch (Exception ex) + { + return content.Error(ex.Message); + } + } + } + +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/AGV/Partial/agvCallback.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/AGV/Partial/agvCallback.cs" new file mode 100644 index 0000000..6f6cb00 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/AGV/Partial/agvCallback.cs" @@ -0,0 +1,55 @@ +锘縰sing Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Comm.AGVTask; +using WIDESEA_Core; +using WIDESEA_Model.Models; +using WIDESEA_StorageTaskRepository; + +namespace WIDESEA_StoragIntegrationServices +{ + public partial class ToAGVService + { + /// <summary> + /// AGV鍥炶皟鎺ュ彛 + /// </summary> + /// <param name="taskRespon"></param> + /// <returns></returns> + public WebResponseContent agvCallback(object taskRespon) + { + WebResponseContent content = new WebResponseContent(); + agvTask task = new agvTask(); + try + { + task = JsonConvert.DeserializeObject<agvTask>(taskRespon.ToString()); + if (task == null) + { + throw new Exception("AGV璋冪敤鎺ュ彛澶辫触锛氭棤璇锋眰鍙傛暟"); + } + + + if (task.method.ToLower() == "apply") //AGV鏀炬枡鐢宠 + { + //todo + } + + if (task.method.ToLower() == "end") //AGV浠诲姟缁撴潫 + { + + //todo + //_taskRepository.QueryFirst(x=>x.SourceAddress == task.) + } + + + return content.OK(); + } + catch (Exception ex) + { + return content.Error($"AGV鍥炶皟寮傚父:{ex.Message}"); + } + } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/AGV/Partial/genAgvSchedulingTask.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/AGV/Partial/genAgvSchedulingTask.cs" new file mode 100644 index 0000000..51d2775 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/AGV/Partial/genAgvSchedulingTask.cs" @@ -0,0 +1,66 @@ +锘縰sing MailKit; +using Mapster; +using Masuit.Tools; +using Masuit.Tools.Security; +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Comm.WCSInterface.Requst; +using WIDESEA_Common; +using WIDESEA_Core; +using WIDESEA_Core.Enums; +using WIDESEA_IStoragIntegrationServices; +using WIDESEA_Model.Models; +using WIDESEA_StorageTaskRepository; + +namespace WIDESEA_StoragIntegrationServices +{ + public partial class ToAGVService + { + /// <summary> + /// 涓嬪彂AGV浠诲姟 --寰呮祴璇曞畬鍠� + /// </summary> + /// <param name="jsondata"></param> + /// <returns></returns> + public WebResponseContent genAgvSchedulingTask(Dt_Task taskinfo) + { + WebResponseContent content = new WebResponseContent(); + try + { + + genAgvSchedulingTask schedulingTask = new genAgvSchedulingTask + { + reqCode = Guid.NewGuid().ToString().Replace("-", ""), + clientCode = "WMS", + //taskTyp = tasktype, + ctnrTyp = "2", + //data = taskinfo.task_barcode, + positionCodePath = new List<position> + { + new position { positionCode = taskinfo.SourceAddress, type = "05" }, + new position { positionCode = taskinfo.TargetAddress, type = "05" }, + }, + priority = "1", //浼樺厛绾� + agvCode = "",//agvcode, + //taskCode = taskinfo.task_id.ToString(), + }; + + + LogFactory.GetLog("涓嬪彂AGV浠诲姟").Info(true, $"\r\r--------------------------------------"); + LogFactory.GetLog("涓嬪彂AGV浠诲姟").Info(true, taskinfo.ToJsonString()); + + return content; + + } + catch (Exception ex) + { + LogFactory.GetLog("涓嬪彂AGV浠诲姟").Info(true, $"\r\r--------------------------------------"); + LogFactory.GetLog("涓嬪彂AGV浠诲姟").Info(true, ex.Message); + return content.Error($"璇锋眰寮傚父锛歿ex.Message}"); + } + } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/AGV/ToAGVService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/AGV/ToAGVService.cs" new file mode 100644 index 0000000..2d67693 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/AGV/ToAGVService.cs" @@ -0,0 +1,45 @@ +锘縰sing LogLibrary.Log; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_IBusinessesRepository; +using WIDESEA_IServices; +using WIDESEA_IStorageBasicRepository; +using WIDESEA_IStorageTaskRepository; +using WIDESEA_IStoragIntegrationServices; +using WIDESEA_Repository; +using WIDESEAWCS_BasicInfoRepository; + +namespace WIDESEA_StoragIntegrationServices +{ + public partial class ToAGVService : IToAGVService + { + private readonly ILocationInfoRepository _locationRepository; + private readonly IDt_TaskRepository _taskRepository; + private readonly IStockInfoRepository _stockInfoRepository; + private readonly ISys_ConfigService _configService; + private readonly IDt_StationManagerRepository _stationManagerRepository; + private readonly IDt_AreaInfoRepository _areaInfoRepository; + private readonly IDt_CheckResultRepository _checkResultRepository; + private readonly IToZYService _toZYService; + private readonly IDt_Task_HtyRepository _task_HtyRepository; + private readonly LogFactory LogFactory = new LogFactory(); + + public static string AGV_Interface = "http://172.21.7.215:8182/rcms/services/rest/hikRpcService"; + + public ToAGVService(ILocationInfoRepository locationRepository,IDt_TaskRepository taskRepository, IStockInfoRepository stockInfoRepository, ISys_ConfigService configService, IDt_StationManagerRepository stationManagerRepository, IDt_AreaInfoRepository dt_AreaInfoRepository, IDt_CheckResultRepository checkResultRepository, IToZYService toZYService , IDt_Task_HtyRepository task_HtyRepository) + { + _locationRepository = locationRepository; + _taskRepository = taskRepository; + _stockInfoRepository = stockInfoRepository; + _configService = configService; + _stationManagerRepository = stationManagerRepository; + _areaInfoRepository = dt_AreaInfoRepository; + _checkResultRepository = checkResultRepository; + _toZYService = toZYService; + _task_HtyRepository = task_HtyRepository; + } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/MCS/MCSService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/MCS/MCSService.cs" new file mode 100644 index 0000000..d224489 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/MCS/MCSService.cs" @@ -0,0 +1,37 @@ +锘縰sing LogLibrary.Log; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_IBusinessesRepository; +using WIDESEA_IServices; +using WIDESEA_IStorageBasicRepository; +using WIDESEA_IStorageTaskRepository; +using WIDESEA_IStoragIntegrationServices; +using WIDESEA_Repository; +using WIDESEAWCS_BasicInfoRepository; + +namespace WIDESEA_StoragIntegrationServices +{ + public partial class MCSService : IMCSService + { + private readonly ILocationInfoRepository _locationRepository; + private readonly IDt_TaskRepository _taskRepository; + private readonly IStockInfoRepository _stockInfoRepository; + private readonly ISys_ConfigService _configService; + private readonly IDt_StationManagerRepository _stationManagerRepository; + private readonly IDt_AreaInfoRepository _areaInfoRepository; + private readonly LogFactory LogFactory = new LogFactory(); + + public MCSService(ILocationInfoRepository locationRepository,IDt_TaskRepository taskRepository,IStockInfoRepository stockInfoRepository, ISys_ConfigService configService, IDt_StationManagerRepository stationManagerRepository,IDt_AreaInfoRepository dt_AreaInfoRepository) + { + _locationRepository = locationRepository; + _taskRepository = taskRepository; + _stockInfoRepository = stockInfoRepository; + _configService = configService; + _stationManagerRepository = stationManagerRepository; + _areaInfoRepository = dt_AreaInfoRepository; + } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/MCS/Partial/ModifyAccessStatus.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/MCS/Partial/ModifyAccessStatus.cs" new file mode 100644 index 0000000..9612117 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/MCS/Partial/ModifyAccessStatus.cs" @@ -0,0 +1,64 @@ +锘縰sing MailKit; +using Masuit.Tools; +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Core; +using WIDESEA_DTO; + +namespace WIDESEA_StoragIntegrationServices +{ + public partial class MCSService + { + public WebResponseContent ModifyAccessStatus(object json) + { + WebResponseContent content = new WebResponseContent(); + try + { + if (string.IsNullOrEmpty(json.ToString())) throw new Exception("涓婁紶鍙傛暟涓虹┖"); + + var result = JsonConvert.DeserializeObject<LocationWorkState>(json.ToString()); + + var locationinfo = _locationRepository.QueryFirst(x => x.AreaId == result.LocationArea && x.LocationCode == result.LocationID); + if (locationinfo != null) + { + //妫�娴嬫煖鎻愪緵鐨勮揣浣嶇姸鎬侊紝鍙湁wms鏈攣瀹氫笖鎻愪緵鐨勭姸鎬佷负鍏佽鎵嶅厑璁告斁璐� + if (locationinfo.Remark != result.StateCode.ToString()) + { + locationinfo.Remark = result.StateCode.ToString(); + _locationRepository.UpdateData(locationinfo); + } + } + else + throw new Exception("璐т綅涓嶅瓨鍦�"); + + + LogFactory.GetLog("鍒嗗搴撲綅鍚屾").Info(true, $"\r\r--------------------------------------"); + LogFactory.GetLog("鍒嗗搴撲綅鍚屾").Info(true, result.ToJsonString()); + return content.OK(); + } + catch (Exception ex) + { + return content.Error(ex.Message); + } + } + + + //private static string LocationStatusByCode(int code) + //{ + // string str = null; + // switch (code) + // { + // case 1: str = "LocationState_Allows"; break; + // case 2: str = "LocationState_NotAllows"; break; + // //case 2: str = LocationState.LocationLock.ToString(); break; + // default: + // str = "LocationState_NotAllows"; break; + // } + // return str; + //} + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/MCS/Partial/NotifyFinishTest.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/MCS/Partial/NotifyFinishTest.cs" new file mode 100644 index 0000000..6457a2e --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/MCS/Partial/NotifyFinishTest.cs" @@ -0,0 +1,141 @@ +锘縰sing LogLibrary.Log; +using Masuit.Tools; +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Core; +using WIDESEA_Core.Const; +using WIDESEA_Core.Enums; +using WIDESEA_Core.Helper; +using WIDESEA_DTO; +using WIDESEA_DTO.WMS; +using WIDESEA_Model.Models; +using WIDESEA_StorageBasicRepository; +using WIDESEAWCS_Model.Models; + +namespace WIDESEA_StoragIntegrationServices +{ + + public partial class MCSService + { + public WebResponseContent NotifyFinishTest(object json) + { + WebResponseContent content = new WebResponseContent(); + try + { + if (string.IsNullOrEmpty(json.ToString())) throw new Exception("涓婁紶鍙傛暟涓虹┖"); + + var result = JsonConvert.DeserializeObject<NotifyFinishTest>(json.ToString()); + + if (string.IsNullOrEmpty(result?.PalletBarcode)) + throw new Exception("涓婁紶鎵樼洏鍙蜂负绌�"); + + var location = _locationRepository.QueryFirst(x => x.AreaId == result.LocationArea && x.LocationCode == result.LocationID); + + if (location == null) throw new Exception("鏈煡搴撲綅"); + + if (_taskRepository.QueryFirst(x => x.SourceAddress == result.LocationID && x.Roadway == location.RoadwayNo) != null) + { + throw new Exception("褰撳墠搴撲綅宸插瓨鍦ㄤ换鍔�"); + } + + Dt_StationManager stationManager; + if (result.IsNG == 1) + { + stationManager = _stationManagerRepository.QueryFirst(x => x.Roadway == location.RoadwayNo && x.stationType == 4); + } + else + { + stationManager = _stationManagerRepository.QueryFirst(x => x.Roadway == location.RoadwayNo && x.stationType == 2); + } + + if (stationManager == null) throw new Exception("鏈煡绔欏彴"); + + int taskNum = _taskRepository.GetTaskNo().Result; + + Dt_Task task = new Dt_Task + { + CreateDate = DateTime.Now, + Creater = "HK", + CurrentAddress = result.LocationID, + Grade = result.IsNG == 1 ? 1 : 2, + Dispatchertime = DateTime.Now, + PalletCode = result.PalletBarcode, + Roadway = location.RoadwayNo, + SourceAddress = result.LocationID, + TaskState = (int)TaskOutStatusEnum.OutNew, + TaskType = result.IsNG == 1 ? (int)TaskOutboundTypeEnum.OutNG : (int)TaskOutboundTypeEnum.Outbound, + TargetAddress = stationManager.stationLocation, + NextAddress = stationManager.stationChildCode, + TaskNum = taskNum, //_taskRepository.GetTaskNo().Result, + TaskId = 0, + }; + + // 灏濊瘯娣诲姞鏂颁换鍔� + WMSTaskDTO taskDTO = new WMSTaskDTO() + { + TaskNum = task.TaskNum.Value, + Grade = result.IsNG == 1 ? 1 : 2, + PalletCode = task.PalletCode, + RoadWay = task.Roadway, + SourceAddress = task.SourceAddress, + TargetAddress = task.TargetAddress, + TaskState = task.TaskState.Value, + Id = 0, + TaskType = result.IsNG == 1 ? (int)TaskOutboundTypeEnum.OutNG : (int)TaskOutboundTypeEnum.Outbound, + }; + + var configs = _configService.GetConfigsByCategory(CateGoryConst.CONFIG_SYS_IPAddress); + var ipAddress = configs.FirstOrDefault(x => x.ConfigKey == SysConfigConst.WCSIPAddress)?.ConfigValue; + var ReceiveByWMSTask = configs.FirstOrDefault(x => x.ConfigKey == SysConfigConst.ReceiveByWMSTask)?.ConfigValue; + if (ReceiveByWMSTask == null || ipAddress == null) + { + throw new Exception("WMS IP 鏈厤缃�"); + } + var wmsIpAddrss = ipAddress + ReceiveByWMSTask; + + var respon = HttpHelper.Post(wmsIpAddrss, JsonConvert.SerializeObject(taskDTO)); //http://localhost:9291/api/Task/ReceiveTask, + if (respon != null) + { + WebResponseContent respone = JsonConvert.DeserializeObject<WebResponseContent>(respon.ToString()); + if (respone.Status) + { + var taskId = _taskRepository.AddData(task); + } + + else + { + throw new Exception("WCS澶勭悊澶辫触:" + respone.Message); + } + } + else + { + throw new Exception("WCS澶勭悊澶辫触"); + } + //WMSTaskDTO taskDTO = new WMSTaskDTO + //{ + // Id = 0, + // Grade = 1, + // PalletCode = result.PalletBarcode, + // RoadWay = location.RoadwayNo, + // SourceAddress = result.LocationID, + // TargetAddress = task.TargetAddress, + // TaskNum = taskNum, //_taskRepository.GetTaskNo().Result, + // TaskState = (int)TaskOutStatusEnum.OutNew, + //}; + LogFactory.GetLog("鍒嗗娴嬭瘯瀹屾垚閫氱煡").Info(true, $"\r\r--------------------------------------"); + LogFactory.GetLog("鍒嗗娴嬭瘯瀹屾垚閫氱煡").Info(true, result.ToJsonString()); + return content.OK(); + } + catch (Exception ex) + { + LogFactory.GetLog("鍒嗗娴嬭瘯瀹屾垚閫氱煡").Info(true, $"\r\r--------------------------------------"); + LogFactory.GetLog("鍒嗗娴嬭瘯瀹屾垚閫氱煡").Info(true, ex.Message); + return content.Error(ex.Message); + } + } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/MCS/Partial/RequestChangeLocation.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/MCS/Partial/RequestChangeLocation.cs" new file mode 100644 index 0000000..f9c547c --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/MCS/Partial/RequestChangeLocation.cs" @@ -0,0 +1,299 @@ +锘縰sing AngleSharp.Dom; +using log4net.Core; +using Masuit.Tools; +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Common; +using WIDESEA_Core; +using WIDESEA_Core.Const; +using WIDESEA_Core.Enums; +using WIDESEA_Core.Helper; +using WIDESEA_DTO; +using WIDESEA_DTO.WMS; +using WIDESEA_Model.Models; + +namespace WIDESEA_StoragIntegrationServices +{ + public partial class MCSService + { + /// <summary> + /// 璇锋眰绉诲簱 + /// </summary> + /// <param name="json"></param> + /// <returns></returns> + public WebResponseContent RequestChangeLocation(object json) + { + WebResponseContent content = new WebResponseContent(); + try + { + if (string.IsNullOrEmpty(json.ToString())) throw new Exception("璇锋眰鍙傛暟涓虹┖"); + + var result = JsonConvert.DeserializeObject<RequestReMove>(json.ToString()); + + var location = _locationRepository.QueryFirst(x => x.AreaId == result.LocationArea && x.LocationCode == result.LocationID); + + if (location == null) throw new Exception("鏈煡搴撲綅"); + + if (_taskRepository.QueryFirst(x => x.SourceAddress == result.LocationID && x.Roadway == location.RoadwayNo) != null) + { + throw new Exception("褰撳墠搴撲綅宸插瓨鍦ㄤ换鍔�"); + } + + switch (result.MoveType) + { + case 1: + CreateMoveTask(location); + break; + case 5: + CreateFireTask(location); + break; + default: + throw new Exception("鏃犳晥鐨勭Щ搴撶敵璇风被鍨�"); + } + + #region 鐏鍑哄簱 + //if (result.MoveType == 5) + //{ + // Console.WriteLine($"鍒嗗妫�娴嬫煖鐏瑙﹀彂:搴撲綅{result.LocationID}"); + + // //鏌ユ壘娑堥槻绔欏彴 + // var station = _stationManagerRepository.QueryFirst(t => t.Roadway == location.RoadwayNo + // && t.stationType == (int)StationManager.FireStation + // /*&& t. == "Enable"*/); + // if (station == null) + // { + // throw new Exception("娑堥槻绔欏彴鏈厤缃�!"); + // } + // //鏌ユ壘搴撳瓨淇℃伅 + // var barcodeData = _stockInfoRepository.QueryFirst(t => t.LocationCode == location.LocationCode); + // //鎵樼洏鐮� + // string barcode = string.Empty; + // if (barcodeData != null) + // { + // barcode = barcodeData.PalletCode; + // } + // else + // { + // //鏃犲簱瀛樹俊鎭紝鐢熸垚闅忔満鎵樼洏鐮� + // barcode = "M" + DateTime.Now.ToString("MMddHHmmss") + "-" + new Random().Next(100, 1000); + // } + // int taskNum = _taskRepository.GetTaskNo().Result; + // Dt_Task task = new Dt_Task + // { + // CreateDate = DateTime.Now, + // Creater = "HK", + // CurrentAddress = result.LocationID, + // Grade = 1, + // Dispatchertime = DateTime.Now, + // PalletCode = barcode, + // Roadway = location.RoadwayNo, + // SourceAddress = result.LocationID, + // TaskState = (int)TaskOutStatusEnum.OutNew, + // TaskType = 500, + // TargetAddress = station.stationLocation, + // NextAddress = station.stationChildCode, + // TaskNum = taskNum, //_taskRepository.GetTaskNo().Result, + // TaskId = 0, + // }; + + // // 灏濊瘯娣诲姞鏂颁换鍔� + // WMSTaskDTO taskDTO = new WMSTaskDTO() + // { + // TaskNum = task.TaskNum.Value, + // Grade = 1, + // PalletCode = task.PalletCode, + // RoadWay = task.Roadway, + // SourceAddress = task.SourceAddress, + // TargetAddress = task.TargetAddress, + // TaskState = task.TaskState.Value, + // Id = 0, + // TaskType = 500, + // }; + //} + #endregion + + LogFactory.GetLog("鍒嗗绉诲簱鐢宠").Info(true, $"\r\r--------------------------------------"); + LogFactory.GetLog("鍒嗗绉诲簱鐢宠").Info(true, result.ToJsonString()); + return content.OK(); + } + catch (Exception ex) + { + LogFactory.GetLog("鍒嗗绉诲簱鐢宠").Info(true, $"\r\r--------------------------------------"); + LogFactory.GetLog("鍒嗗绉诲簱鐢宠").Info(true, ex.Message); + return content.Error(ex.Message); + } + } + + private void CreateMoveTask(DtLocationInfo location) + { + Console.WriteLine($"鍒嗗鐢宠绉诲簱:搴撲綅{location.LocationCode}"); + + //鏌ユ壘鍙敤搴撲綅 + DtLocationInfo CanRelocation = _locationRepository.QueryFirst(x => x.LocationStatus == (int)LocationEnum.Free && x.RoadwayNo == location.RoadwayNo && x.EnalbeStatus == 1 && x.LocationType == 2 && x.Remark == "1"); + + if (CanRelocation == null) throw new Exception("鐢宠绉诲簱澶辫触锛氭棤鍙敤搴撲綅"); + + //鏌ユ壘搴撳瓨淇℃伅 + var stockInfo = _stockInfoRepository.QueryFirst(x => x.LocationCode == location.LocationCode && x.LocationInfo.RoadwayNo == location.RoadwayNo); + + if (stockInfo == null) throw new Exception("鐢宠绉诲簱澶辫触锛氭棤搴撳瓨璁板綍"); + + //淇敼绉诲簱鐩爣搴撲綅鐘舵�� + CanRelocation.LocationStatus = (int)LocationEnum.FreeDisable; + + int taskNum = _taskRepository.GetTaskNo().Result; + Dt_Task task = new Dt_Task + { + CreateDate = DateTime.Now, + Creater = "HK", + CurrentAddress = location.LocationCode, + Grade = 1, + Dispatchertime = DateTime.Now, + PalletCode = stockInfo.PalletCode, + Roadway = location.RoadwayNo, + SourceAddress = location.LocationCode, + TaskState = (int)TaskStatus.Created, + TaskType = (int)TaskRelocationTypeEnum.Relocation, + TargetAddress = CanRelocation.LocationCode, + NextAddress = CanRelocation.LocationCode, + TaskNum = taskNum, //_taskRepository.GetTaskNo().Result, + TaskId = 0, + }; + + // 灏濊瘯娣诲姞鏂颁换鍔� + WMSTaskDTO taskDTO = new WMSTaskDTO() + { + TaskNum = task.TaskNum.Value, + Grade = 1, + PalletCode = task.PalletCode, + RoadWay = task.Roadway, + SourceAddress = task.SourceAddress, + TargetAddress = task.TargetAddress, + TaskState = task.TaskState.Value, + Id = 0, + TaskType = task.TaskType, + }; + + var configs = _configService.GetConfigsByCategory(CateGoryConst.CONFIG_SYS_IPAddress); + var ipAddress = configs.FirstOrDefault(x => x.ConfigKey == SysConfigConst.WCSIPAddress)?.ConfigValue; + var ReceiveByWMSTask = configs.FirstOrDefault(x => x.ConfigKey == SysConfigConst.ReceiveByWMSTask)?.ConfigValue; + if (ReceiveByWMSTask == null || ipAddress == null) + { + throw new Exception("WMS IP 鏈厤缃�"); + } + var wmsIpAddrss = ipAddress + ReceiveByWMSTask; + + var respon = HttpHelper.Post(wmsIpAddrss, JsonConvert.SerializeObject(taskDTO)); //http://localhost:9291/api/Task/ReceiveTask, + if (respon != null) + { + WebResponseContent respone = JsonConvert.DeserializeObject<WebResponseContent>(respon.ToString()); + if (respone.Status) + { + //娣诲姞WMS浠诲姟 骞朵慨鏀瑰簱浣嶇姸鎬� + var taskId = _taskRepository.AddData(task); + _locationRepository.UpdateData(CanRelocation); + } + else + { + throw new Exception("WCS澶勭悊澶辫触:" + respone.Message); + } + } + else + { + throw new Exception("WCS澶勭悊澶辫触"); + } + } + + + private void CreateFireTask(DtLocationInfo location) + { + Console.WriteLine($"鍒嗗妫�娴嬫煖鐏瑙﹀彂:搴撲綅{location.LocationCode}"); + + //鏌ユ壘娑堥槻绔欏彴 + var station = _stationManagerRepository.QueryFirst(t => t.Roadway == location.RoadwayNo + && t.stationType == (int)StationManager.FireStation + /*&& t. == "Enable"*/); + if (station == null) + { + throw new Exception("娑堥槻绔欏彴鏈厤缃�!"); + } + //鏌ユ壘搴撳瓨淇℃伅 + var barcodeData = _stockInfoRepository.QueryFirst(t => t.LocationCode == location.LocationCode); + //鎵樼洏鐮� + string barcode = string.Empty; + if (barcodeData != null) + { + barcode = barcodeData.PalletCode; + } + else + { + //鏃犲簱瀛樹俊鎭紝鐢熸垚闅忔満鎵樼洏鐮� + barcode = "M" + DateTime.Now.ToString("MMddHHmmss") + "-" + new Random().Next(100, 1000); + } + int taskNum = _taskRepository.GetTaskNo().Result; + Dt_Task task = new Dt_Task + { + CreateDate = DateTime.Now, + Creater = "HK", + CurrentAddress = location.LocationCode, + Grade = 1, + Dispatchertime = DateTime.Now, + PalletCode = barcode, + Roadway = location.RoadwayNo, + SourceAddress = location.LocationCode, + TaskState = (int)TaskOutStatusEnum.OutNew, + TaskType = 500, + TargetAddress = station.stationLocation, + NextAddress = station.stationChildCode, + TaskNum = taskNum, //_taskRepository.GetTaskNo().Result, + TaskId = 0, + }; + + // 灏濊瘯娣诲姞鏂颁换鍔� + WMSTaskDTO taskDTO = new WMSTaskDTO() + { + TaskNum = task.TaskNum.Value, + Grade = 1, + PalletCode = task.PalletCode, + RoadWay = task.Roadway, + SourceAddress = task.SourceAddress, + TargetAddress = task.TargetAddress, + TaskState = task.TaskState.Value, + Id = 0, + TaskType = 500, + }; + + var configs = _configService.GetConfigsByCategory(CateGoryConst.CONFIG_SYS_IPAddress); + var ipAddress = configs.FirstOrDefault(x => x.ConfigKey == SysConfigConst.WCSIPAddress)?.ConfigValue; + var ReceiveByWMSTask = configs.FirstOrDefault(x => x.ConfigKey == SysConfigConst.ReceiveByWMSTask)?.ConfigValue; + if (ReceiveByWMSTask == null || ipAddress == null) + { + throw new Exception("WMS IP 鏈厤缃�"); + } + var wmsIpAddrss = ipAddress + ReceiveByWMSTask; + + var respon = HttpHelper.Post(wmsIpAddrss, JsonConvert.SerializeObject(taskDTO)); //http://localhost:9291/api/Task/ReceiveTask, + if (respon != null) + { + WebResponseContent respone = JsonConvert.DeserializeObject<WebResponseContent>(respon.ToString()); + if (respone.Status) + { + var taskId = _taskRepository.AddData(task); + } + + else + { + throw new Exception("WCS澶勭悊澶辫触:" + respone.Message); + } + } + else + { + throw new Exception("WCS澶勭悊澶辫触"); + } + } + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/MCS/Partial/RequsetCellInfo.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/MCS/Partial/RequsetCellInfo.cs" new file mode 100644 index 0000000..fde68ec --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/MCS/Partial/RequsetCellInfo.cs" @@ -0,0 +1,67 @@ +锘縰sing Masuit.Tools; +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Core; +using WIDESEA_DTO; +using WIDESEA_IBusinessesRepository; +using WIDESEA_Repository; + +namespace WIDESEA_StoragIntegrationServices +{ + public partial class MCSService + { + /// <summary> + /// 鑾峰彇搴撲綅淇℃伅 + /// </summary> + /// <param name="json"></param> + /// <returns></returns> + public object RequsetCellInfo(object json) + { + WebResponseContent content = new WebResponseContent(); + try + { + if (string.IsNullOrEmpty(json.ToString())) throw new Exception("涓婁紶鍙傛暟涓虹┖"); + + + //var result = JsonConvert.DeserializeObject<RequsetCellInfo>(json.ToString()); + + ////var area = _areaInfoRepository.QueryFirst(x => x.AreaID == result.LocationArea); + + //var location = _locationRepository.QueryFirst(x => x.LocationCode == result.LocationID && x.AreaId == result.LocationArea); + + //if (location != null) + //{ + // throw new Exception("璇锋眰寮傚父锛氭湭鐭ュ簱浣�"); + //} + + //var info = _stockInfoRepository.QueryFirst(x => x.LocationCode == result.LocationID && x.LocationId == location.Id); + + var result = JsonConvert.DeserializeObject<RequsetCellInfo>(json.ToString()); + + var area = _areaInfoRepository.QueryFirst(x => x.AreaID == result.LocationArea); + + var info = _stockInfoRepository.QueryFirst(x => x.LocationCode == result.LocationID && x.AreaCode == area.AreaCode); + //todo + if (info != null) + { + LogFactory.GetLog("鍒嗗鑾峰彇搴撲綅鎵樼洏").Info(true, $"\r\r--------------------------------------"); + LogFactory.GetLog("鍒嗗鑾峰彇搴撲綅鎵樼洏").Info(true, result.ToJsonString()); + return new { code = 1, palletBarcode = info.PalletCode }; + } + else + { + return new { code = 0, palletBarcode = "", message = "搴撲綅鏃犲簱瀛樿褰�" }; + } + + } + catch (Exception ex) + { + return new { code = 0, palletBarcode = "", message = ex.Message }; + } + } + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/ToAPP/Partial/SaveCLinfo.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/ToAPP/Partial/SaveCLinfo.cs" new file mode 100644 index 0000000..a81acea --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/ToAPP/Partial/SaveCLinfo.cs" @@ -0,0 +1,144 @@ +锘� +using Masuit.Tools; +using Newtonsoft.Json; +using System.Text.Json.Nodes; +using System.Xml.Serialization; +using WIDESEA.Common; +using WIDESEA_Common; +using WIDESEA_Common.ZY; +using WIDESEA_Core; +using WIDESEA_Core.Enums; +using WIDESEA_Core.Helper; +using WIDESEA_Model.Models; + +namespace WIDESEA_StoragIntegrationServices +{ + public partial class ToAPPService + { + public WebResponseContent SaveCLinfo(SaveModel saveModel) + { + WebResponseContent content = new WebResponseContent(); + try + { + //濡傚綋鍓嶅瓨鍦ㄦ湭寮�濮嬪叆搴撶殑杞﹁疆鎴栧埗鍔ㄧ洏鏁版嵁,鍒欑姝繚瀛樻柊鏁版嵁 浠ラ槻鏁版嵁娣蜂贡 + var waitInbound = _InWheels_MesRepository.QueryFirst(x => x.Wheels_CurrentStatue == "0"); + if (waitInbound != null) throw new Exception("褰撳墠瀛樺湪鏈紑濮嬪叆搴撶殑杞﹁疆鎴栧埗鍔ㄧ洏,璇峰厛鍏ュ簱鍚庡啀淇濆瓨淇℃伅!"); + + //杞﹁疆鐮� + string clCode = saveModel.MainData["code"].ToString(); + //杞﹁疆鍙� + string clh = saveModel.MainData["clh"].ToString(); + if (string.IsNullOrEmpty(clCode) || string.IsNullOrEmpty(clh)) + throw new Exception($"杞﹁疆鏉$爜涓嶈兘涓虹┖"); + + if (!clCode.Contains("/") && !clCode.ToUpper().StartsWith("L")) throw new Exception($"杞﹁疆鏉$爜閿欒,璇烽噸鏂版牳瀵�"); + + var clinfo = _InWheels_MesRepository.QueryFirst(x => x.Wheels_code == clCode || x.Wheels_Num == clh); + if (clinfo != null) throw new Exception("杞﹁疆褰曞叆淇℃伅宸插瓨鍦�"); + + //妫�娴嬪簱瀛樻槸鍚﹀凡瀛樺湪 + _WheelsStockRepository.QueryFirst(x => x.Wheels_code == clCode || x.Wheels_Num == clh); + if (clinfo != null) throw new Exception("搴撳唴宸插瓨鍦�,璇锋鏌ュ簱瀛�"); + + //搴忓垪鍙� + //string madeUnit = saveModel.MainData["xlh"].ToString(); + + //杞鏉$爜 + string ldtm = saveModel.MainData["ldtm"].ToString(); + //杞﹀瀷 + string Cartype = saveModel.MainData["chexing"].ToString(); + if (string.IsNullOrEmpty(Cartype)) throw new Exception($"杞﹀瀷鍙傛暟涓虹┖,涓嶅厑璁稿叆搴�"); + //閰嶅睘灞� + string psj = saveModel.MainData["psj"].ToString(); + //杞︾粍鍙� + string lcch = saveModel.MainData["lcch"].ToString(); + //鏂版棫 (0-鏂� 1-鏃�) + string newOrOld = saveModel.MainData["neworold"].ToString(); + if (string.IsNullOrEmpty(newOrOld)) throw new Exception($"鏂版棫鍙傛暟涓虹┖,涓嶅厑璁稿叆搴�"); + //杞鍙� + string ldh = saveModel.MainData["ldh"].ToString(); + //杞瀷 + string ldxh = saveModel.MainData["ldxh"].ToString(); + if (string.IsNullOrEmpty(ldxh)) throw new Exception($"杞瀷鍙傛暟涓虹┖,涓嶅厑璁稿叆搴�"); + //姣傚瓟绛夌骇 + string gkdj = saveModel.MainData["gkdj"].ToString(); + if (string.IsNullOrEmpty(gkdj)) throw new Exception($"姣傚瓟绛夌骇鍙傛暟涓虹┖,涓嶅厑璁稿叆搴�"); + //姣傚瓟a鐣岄潰鍧囧�� + string gkzja = saveModel.MainData["gkzja"].ToString(); + //姣傚瓟b鐣岄潰鍧囧�� + string gkzjb = saveModel.MainData["gkzjb"].ToString(); + //姣傚瓟c鐣岄潰鍧囧�� + string gkzjc = saveModel.MainData["gkzjc"].ToString(); + //杞緞鍊� + string ljz = saveModel.MainData["ljz"].ToString(); + + //棰勪及杞緞鍊� + string yglj = saveModel.MainData["yglj"].ToString(); + //灞炴�� + string WheelsProps = saveModel.MainData["clsx"].ToString(); + //杞紭 + string lyh = saveModel.MainData["lyh"].ToString(); + //鍔ㄦ嫋灞炴�� + string mttype = saveModel.MainData["mttype"].ToString(); + if (string.IsNullOrEmpty(mttype)) throw new Exception($"鍔ㄦ嫋灞炴�у弬鏁颁负绌�,涓嶅厑璁稿叆搴�"); + //姣傚瓟鍧囧�� + string gkcc = saveModel.MainData["gkcc"].ToString(); + if (string.IsNullOrEmpty(gkcc)) throw new Exception($"姣傚瓟鍧囧�煎弬鏁颁负绌�,涓嶅厑璁稿叆搴�"); + //鍏ュ簱鏃堕棿 + string rksj = saveModel.MainData["rksj"].ToString(); + if (string.IsNullOrEmpty(rksj)) throw new Exception($"鍏ュ簱鏃堕棿鍙傛暟涓虹┖,涓嶅厑璁稿叆搴�"); + + //妫�娴嬪墿浣欑┖搴撲綅鏁伴噺鏄惁瓒冲 --todo锛氬唴澶栦晶绌哄簱浣嶆娴� + if (_locationRepository.QueryData(x => x.LocationStatus == (int)LocationEnum.Free && x.EnalbeStatus == 1).Count < 2) throw new Exception($"搴撲綅鏁伴噺涓嶈冻,涓嶅厑璁稿叆搴�"); + + //if (newOrOld == "0") + //{ + gkdj = LevelChangeHelper.LevelChangeType(gkdj); + if (string.IsNullOrEmpty(gkdj)) throw new Exception("绛夌骇杞崲澶辫触,璇锋鏌ユ帴鍙g瓑绾у弬鏁�"); + //} + + Dt_InWheels_mes wheels_Mes = new Dt_InWheels_mes + { + Wheels_code = clCode, + Wheels_Type = "1", + Wheels_Num = clh, + CreateDate = DateTime.Now, + Creater = "admin", + WheelsProps = WheelsProps, + Wheels_CarNo = lcch, + Wheels_CarType = Cartype, + Wheels_ldxh = ldxh, + Wheels_CurrentStatue = "0", + Wheels_ldtm = ldtm, + Wheels_InDate = rksj, + Wheels_level = gkdj, + Wheels_NewOrOld = newOrOld == "鏃�" ? "1" : "0", + Wheels_psj = psj, + Wheels_gkcc = gkcc, + Wheels_gkzja = gkzja, + Wheels_gkzjb = gkzjb, + Wheels_gkzjc = gkzjc, + Wheels_ldh = ldh, + Wheels_ljz = ljz, + Wheels_mttype = mttype, + //Wheels_SequenceNum = "", + Wheels_ygljz = yglj, + Wheels_LYH = lyh + }; + + if (_InWheels_MesRepository.AddData(wheels_Mes) > 0) + { + return content.OK("淇濆瓨鎴愬姛"); + } + else + { + return content.Error("淇濆瓨澶辫触"); + } + } + catch (Exception ex) + { + return content.Error($"{ex.Message}"); + } + } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/ToAPP/Partial/SaveCZInfo.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/ToAPP/Partial/SaveCZInfo.cs" new file mode 100644 index 0000000..a243234 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/ToAPP/Partial/SaveCZInfo.cs" @@ -0,0 +1,457 @@ +锘縰sing Newtonsoft.Json; +using SharpCompress.Compressors.Xz; +using System.Reflection.Emit; +using WIDESEA_Common; +using WIDESEA_Common.LevelChange; +using WIDESEA_Core; +using WIDESEA_Core.Const; +using WIDESEA_Core.Enums; +using WIDESEA_Core.Helper; +using WIDESEA_DTO.WMS; +using WIDESEA_Model.Models; +using WIDESEA_StorageBasicRepository; + +namespace WIDESEA_StoragIntegrationServices +{ + public partial class ToAPPService + { + /// <summary> + /// 淇濆瓨杞﹁酱鏁版嵁 + /// </summary> + /// <param name="saveModel"></param> + /// <returns></returns> + public WebResponseContent SaveCZInfo(SaveModel saveModel) + { + WebResponseContent content = new WebResponseContent(); + try + { + //濡傚綋鍓嶅瓨鍦ㄦ湭寮�濮嬪叆搴撶殑杞﹁疆鎴栧埗鍔ㄧ洏鏁版嵁,鍒欑姝繚瀛樻柊鏁版嵁 浠ラ槻鏁版嵁娣蜂贡 + var waitInbound = _CZInfo_MesRepository.QueryFirst(x => x.CurrentStatue == "0"); + if (waitInbound != null) throw new Exception("褰撳墠瀛樺湪鏈紑濮嬪叆搴撶殑杞﹁酱鏁版嵁,璇峰厛涓婃灦鍚姩鍚庡啀淇濆瓨淇℃伅!"); + + //杞﹁酱鏉$爜 + string czCode = saveModel.MainData["cztm"].ToString(); + if (string.IsNullOrEmpty(czCode)) + throw new Exception($"杞﹁酱鏉$爜涓嶈兘涓虹┖"); + + //杞﹁酱鍙� + string czh = saveModel.MainData["czh"].ToString(); + if (string.IsNullOrEmpty(czh)) + throw new Exception($"杞﹁酱鍙蜂笉鑳戒负绌�"); + //var clinfo = _InWheels_MesRepository.QueryFirst(x => x.Wheels_code == czCode); + //if (clinfo != null) throw new Exception("杞﹁疆褰曞叆淇℃伅宸插瓨鍦�"); + + //搴忓垪鍙� + //string madeUnit = saveModel.MainData["xlh"].ToString(); + //杞鏉$爜 + string ldtm = saveModel.MainData["ldtm"].ToString(); + //杞﹀瀷 + string Cartype = saveModel.MainData["chexing"].ToString(); + if (string.IsNullOrEmpty(Cartype)) throw new Exception("閫夐厤澶辫触锛氳溅杞磋溅鍨嬪弬鏁颁负绌�"); + + //杞﹁酱鍨嬪彿 + string czxh = saveModel.MainData["czxh"].ToString(); + + //杞﹁疆鍨嬪彿 + string clxh = saveModel.MainData["clxh"].ToString(); + + //鍔ㄦ嫋灞炴�� + string mttype = saveModel.MainData["mttype"].ToString(); + + //宸﹁疆搴х洿寰凙1 + string zlzA1 = saveModel.MainData["zlzA1"].ToString(); + //宸﹁疆搴х洿寰凙1 + string zlzA2 = saveModel.MainData["zlzA2"].ToString(); + //宸﹁疆搴х洿寰凙1 + string zlzA3 = saveModel.MainData["zlzA3"].ToString(); + //宸﹁疆搴х洿寰凙 + string zlzA = saveModel.MainData["zlza"].ToString(); + + //宸﹁疆搴х洿寰凚1 + string zlzB1 = saveModel.MainData["zlzB1"].ToString(); + //宸﹁疆搴х洿寰凚1 + string zlzB2 = saveModel.MainData["zlzB2"].ToString(); + //宸﹁疆搴х洿寰凚1 + string zlzB3 = saveModel.MainData["zlzB3"].ToString(); + //宸﹁疆搴х洿寰凚 + string zlzB = saveModel.MainData["zlzb"].ToString(); + + //宸﹁疆搴х洿寰凜1 + string zlzC1 = saveModel.MainData["zlzC1"].ToString(); + //宸﹁疆搴х洿寰凜1 + string zlzC2 = saveModel.MainData["zlzC2"].ToString(); + //宸﹁疆搴х洿寰凜1 + string zlzC3 = saveModel.MainData["zlzC3"].ToString(); + //宸﹁疆搴х洿寰凜 + string zlzC = saveModel.MainData["zlzc"].ToString(); + + //鍙宠疆搴х洿寰凙1 + string ylzA1 = saveModel.MainData["ylzA1"].ToString(); + //鍙宠疆搴х洿寰凙1 + string ylzA2 = saveModel.MainData["ylzA2"].ToString(); + //鍙宠疆搴х洿寰凙1 + string ylzA3 = saveModel.MainData["ylzA3"].ToString(); + //鍙宠疆搴х洿寰凙 + string ylzA = saveModel.MainData["ylza"].ToString(); + + //鍙宠疆搴х洿寰凚1 + string ylzB1 = saveModel.MainData["ylzB1"].ToString(); + //鍙宠疆搴х洿寰凚1 + string ylzB2 = saveModel.MainData["ylzB2"].ToString(); + //鍙宠疆搴х洿寰凚1 + string ylzB3 = saveModel.MainData["ylzB3"].ToString(); + //鍙宠疆搴х洿寰凚 + string ylzB = saveModel.MainData["ylzb"].ToString(); + + //鍙宠疆搴х洿寰凜1 + string ylzC1 = saveModel.MainData["ylzC1"].ToString(); + //鍙宠疆搴х洿寰凜1 + string ylzC2 = saveModel.MainData["ylzC2"].ToString(); + //鍙宠疆搴х洿寰凜1 + string ylzC3 = saveModel.MainData["ylzC3"].ToString(); + //鍙宠疆搴х洿寰凜 + string ylzC = saveModel.MainData["ylzc"].ToString(); + + //宸﹁疆搴х洿寰� + string zlzzj = saveModel.MainData["zlzzj"].ToString(); + //鍙宠疆搴х洿寰� + string ylzzj = saveModel.MainData["ylzzj"].ToString(); + + //鏂版棫 + string newOrOld = saveModel.MainData["NOdirection"].ToString(); + if (string.IsNullOrEmpty(newOrOld)) throw new Exception("鏈�夋嫨鏂版棫绫诲瀷,璇烽�夋嫨!"); + + //杞﹁疆浣嶇疆 + string wheelsPosition = saveModel.MainData["wheelsPosition"].ToString(); + if (string.IsNullOrEmpty(wheelsPosition)) throw new Exception("鏈�夋嫨杞﹁疆浣嶇疆,璇烽�夋嫨!"); + + //宸﹁疆绛夌骇 + string leftLevel = saveModel.MainData["zlzdj"].ToString(); + if (string.IsNullOrEmpty(leftLevel)) throw new Exception("閫夐厤澶辫触锛氳溅杞村乏杞骇绛夌骇鍙傛暟涓虹┖"); + //鍙宠疆绛夌骇 + string rightLevel = saveModel.MainData["ylzdj"].ToString(); + if (string.IsNullOrEmpty(rightLevel)) throw new Exception("閫夐厤澶辫触锛氳溅杞村彸杞骇绛夌骇鍙傛暟涓虹┖"); + + //缁翠慨浠诲姟 + string wxrw = saveModel.MainData["wxrw"].ToString(); + if (string.IsNullOrEmpty(wxrw)) throw new Exception("閫夐厤澶辫触锛氱淮淇换鍔″弬鏁颁负绌�"); + + string level = string.Empty; + //string rightlevel = string.Empty; + if ("all".Equals(wheelsPosition)) + { + level = LevelChangeHelper.LevelChangeType(leftLevel); + if (string.IsNullOrEmpty(level)) throw new Exception("绛夌骇杞崲澶辫触,璇锋鏌ユ帴鍙g瓑绾у弬鏁�"); + } + else if ("left".Equals(wheelsPosition)) + { + level = LevelChangeHelper.LevelChangeType(leftLevel); + if (string.IsNullOrEmpty(level)) throw new Exception("绛夌骇杞崲澶辫触,璇锋鏌ユ帴鍙g瓑绾у弬鏁�"); + //level = leftLevel; + } + else if ("rihgt".Equals(wheelsPosition)) + { + level = LevelChangeHelper.LevelChangeType(rightLevel); + if (string.IsNullOrEmpty(level)) throw new Exception("绛夌骇杞崲澶辫触,璇锋鏌ユ帴鍙g瓑绾у弬鏁�"); + //level = rightLevel; + } + + string rw = CheckTaskChangeHelper.CheckTaskChange(wxrw); + if (string.IsNullOrEmpty(rw)) throw new Exception("缁翠慨浠诲姟杞崲澶辫触,璇锋鏌ョ淮淇换鍔″弬鏁�"); + + if (rw != newOrOld) throw new Exception("閫夐厤澶辫触:閫夐厤鏂版棫杞笌缁翠慨浠诲姟瑙f瀽涓嶄竴鑷�"); + + Dt_SelectionStandards selectionStandards = _SelectionStandardsRepository.QueryFirst(x => x.CarType.Contains(Cartype) && x.mttype == mttype && x.neworold == newOrOld && level.Contains(x.gkdj)); + if (selectionStandards == null) throw new Exception($"姝よ溅鍨媨Cartype}鐨勯�夐厤鏍囧噯寮傚父,璇锋牳瀵归�夐厤鏍囧噯淇℃伅!"); + + Dt_CZInfo_mes CZInfo_Mes = new Dt_CZInfo_mes + { + CZTM = czCode, + CHEXING = Cartype, + CreateDate = DateTime.Now, + Creater = "admin", + CurrentStatue = "1", + CZH = czh, + CZXH = czxh, + LDTM = ldtm, + MTTYPE = mttype, + ZLZA1 = zlzA1, + ZLZA2 = zlzA2, + ZLZA3 = zlzA3, + ZLZA = zlzA, + ZLZB1 = zlzB1, + ZLZB2 = zlzB2, + ZLZB3 = zlzB3, + ZLZB = zlzB, + ZLZC1 = zlzC1, + ZLZC2 = zlzC2, + ZLZC3 = zlzC3, + ZLZC = zlzC, + YLZA1 = ylzA1, + YLZA2 = ylzA2, + YLZA3 = ylzA3, + YLZA = ylzA, + YLZB1 = ylzB1, + YLZB2 = ylzB2, + YLZB3 = ylzB3, + YLZB = ylzB, + YLZC1 = ylzC1, + YLZC2 = ylzC2, + YLZC3 = ylzC3, + YLZC = ylzC, + ZLZZJ = zlzzj, + YLZZJ = ylzzj, + ZLZDJ = leftLevel, + YLZDJ = rightLevel, + WXRW = wxrw + }; + + //宸﹀嚭搴撹溅杞� + Dt_WheelsStock leftContainer = null; + //鍙冲嚭搴撹溅杞� + Dt_WheelsStock rightContainer = null; + + //鍚屾俯鏃堕棿 + var hourpara = _configService.GetByConfigKey(CateGoryConst.CONFIG_SYS_Parameters, SysConfigConst.TempHour); + int hour = hourpara.ConfigValue.ObjToInt(); + + //鎵惧嚭鎵�鏈夌鍚堟潯浠剁殑搴撳瓨杞﹁疆 + var WheelsList = _WheelsStockRepository.QueryData(x => x.Wheels_CurrentStatue == 1 && x.Wheels_mttype == CZInfo_Mes.MTTYPE && x.Wheels_ldxh == clxh && x.Wheels_NewOrOld == newOrOld && x.CreateDate.AddHours(hour) <= DateTime.Now); + //x.Wheels_CarType == CZInfo_Mes.CHEXING && x.Wheels_ldtm == CZInfo_Mes.LDTM && selectionStandards.CarType.Contains(x.Wheels_CarType) + if (null != WheelsList && WheelsList.Count > 0) + { + if ("all".Equals(wheelsPosition) || string.IsNullOrEmpty(wheelsPosition)) + { + if (null == leftContainer) + { + leftContainer = _WheelsStockService.GetSelectionWheelsStock(WheelsList, selectionStandards, CZInfo_Mes, "left", newOrOld); + if (null != leftContainer) + WheelsList.Remove(leftContainer); + } + if (null == rightContainer) + { + rightContainer = _WheelsStockService.GetSelectionWheelsStock(WheelsList, selectionStandards, CZInfo_Mes, "right", newOrOld); + if (null != rightContainer) + WheelsList.Remove(rightContainer); + } + //if (null == leftContainer || null == rightContainer) + } + else if ("left".Equals(wheelsPosition)) + { + leftContainer = _WheelsStockService.GetSelectionWheelsStock(WheelsList, selectionStandards, CZInfo_Mes, "left", newOrOld); + //if (null == leftContainer) + } + else if ("right".Equals(wheelsPosition)) + { + rightContainer = _WheelsStockService.GetSelectionWheelsStock(WheelsList, selectionStandards, CZInfo_Mes, "right", newOrOld); + //if (null == rightContainer) + } + } + + if ("all".Equals(wheelsPosition)) + { + if (null == leftContainer || null == rightContainer) + return content.Error("鏈壘鍒颁袱渚у彲鍖归厤鐨勫嚭搴撹溅杞�,杞﹀瀷锛�" + Cartype); + + + } + + if (null != leftContainer || null != rightContainer) + { + List<Dt_Task> listTask = new List<Dt_Task>(); + List<DtLocationInfo> locationInfos = new List<DtLocationInfo>(); + List<Dt_WheelsStock> wheelsStocks = new List<Dt_WheelsStock>(); + List<WMSTaskDTO> listTaskDTO = new List<WMSTaskDTO>(); + if (null != leftContainer) + { + Dt_Task leftTask = CreateOutTask(leftContainer, czCode); + + leftContainer.Wheels_CurrentStatue = 2; + + DtLocationInfo lefolocation = _locationRepository.QueryFirst(x => x.LocationCode == leftContainer.Wheels_Location); + lefolocation.LocationStatus = (int)LocationEnum.InStockDisable; + + //int taskNum = _taskRepository.GetTaskNo().Result; + //Dt_Task leftTask = new Dt_Task + //{ + // CreateDate = DateTime.Now, + // Creater = "admin", + // CurrentAddress = leftContainer.Wheels_Location, + // Dispatchertime = DateTime.Now, + // Grade = 1, + // IsCheck = true, + // NextAddress = "2010", + // PalletCode = leftContainer.Wheels_code, + // Roadway = "SC1", + // SourceAddress = leftContainer.Wheels_Location, + // TargetAddress = "2021", + // TaskNum = taskNum, + // TaskState = (int)TaskOutStatusEnum.OutNew, + // TaskType = (int)TaskOutboundTypeEnum.OutWheels + //}; + WMSTaskDTO leftTaskDTO = new WMSTaskDTO + { + IsCheck = true, + Grade = 1, + RoadWay = "SC1", + PalletCode = leftContainer.Wheels_Num, + SourceAddress = leftContainer.Wheels_Location, + TargetAddress = "2021", + TaskNum = leftTask.TaskNum.Value, + TaskState = (int)TaskOutStatusEnum.OutNew, + TaskType = (int)TaskOutboundTypeEnum.OutWheels, + CarType = leftContainer.Wheels_CarType, + WheelsNewOrOld = leftContainer.Wheels_NewOrOld, + wheels_gkcc = leftContainer.Wheels_gkcc, + wheels_mttype = leftContainer.Wheels_mttype, + WheelsLX = leftContainer.Wheels_ldxh + }; + + listTask.Add(leftTask); + listTaskDTO.Add(leftTaskDTO); + wheelsStocks.Add(leftContainer); + locationInfos.Add(lefolocation); + } + if (null != rightContainer) + { + Dt_Task rightTask = CreateOutTask(rightContainer, czCode); + + rightContainer.Wheels_CurrentStatue = 2; + + DtLocationInfo rightlocation = _locationRepository.QueryFirst(x => x.LocationCode == rightContainer.Wheels_Location); + rightlocation.LocationStatus = (int)LocationEnum.InStockDisable; + //int rightTaskNum = _taskRepository.GetTaskNo().Result; + //Dt_Task rightTask = new Dt_Task + //{ + // CreateDate = DateTime.Now, + // Creater = "admin", + // CurrentAddress = rightContainer.Wheels_Location, + // Dispatchertime = DateTime.Now, + // Grade = 1, + // IsCheck = true, + // NextAddress = "2010", + // PalletCode = rightContainer.Wheels_code, + // Roadway = "SC1", + // SourceAddress = rightContainer.Wheels_Location, + // TargetAddress = "2021", + // TaskNum = rightTaskNum, + // TaskState = (int)TaskOutStatusEnum.OutNew, + // TaskType = (int)TaskOutboundTypeEnum.OutWheels, + //}; + WMSTaskDTO rihgtTaskDTO = new WMSTaskDTO + { + IsCheck = true, + Grade = 1, + RoadWay = "SC1", + PalletCode = rightContainer.Wheels_Num, + SourceAddress = rightContainer.Wheels_Location, + TargetAddress = "2021", + TaskNum = rightTask.TaskNum.Value, + TaskState = (int)TaskOutStatusEnum.OutNew, + TaskType = (int)TaskOutboundTypeEnum.OutWheels, + CarType = rightContainer.Wheels_CarType, + WheelsNewOrOld = rightContainer.Wheels_NewOrOld, + wheels_gkcc = rightContainer.Wheels_gkcc, + wheels_mttype = rightContainer.Wheels_mttype, + WheelsLX = rightContainer.Wheels_ldxh + }; + listTask.Add(rightTask); + listTaskDTO.Add(rihgtTaskDTO); + wheelsStocks.Add(rightContainer); + locationInfos.Add(rightlocation); + } + + _unitOfWorkManage.BeginTran(); //寮�鍚簨鍔� + + _CZInfo_MesRepository.AddData(CZInfo_Mes); //娣诲姞杞﹁酱淇℃伅 + _WheelsStockRepository.UpdateData(wheelsStocks); //鏇存柊搴撳瓨鏁版嵁 + _locationRepository.UpdateData(locationInfos); //鏇存柊搴撲綅鏁版嵁 + _taskRepository.AddData(listTask); //娣诲姞浠诲姟鏁版嵁 + + //涓嬪彂鍑哄簱浠诲姟缁橶CS + var configs = _configService.GetConfigsByCategory(CateGoryConst.CONFIG_SYS_IPAddress); + var ipAddress = configs.FirstOrDefault(x => x.ConfigKey == SysConfigConst.WCSIPAddress)?.ConfigValue; + var ReceiveByWMSTask = configs.FirstOrDefault(x => x.ConfigKey == SysConfigConst.ReceiveTask)?.ConfigValue; + if (ReceiveByWMSTask == null || ipAddress == null) + { + throw new Exception("WMS IP 鏈厤缃�"); + } + var wmsIpAddrss = ipAddress + ReceiveByWMSTask; + + var respon = HttpHelper.Post(wmsIpAddrss, JsonConvert.SerializeObject(listTaskDTO)); //http://localhost:9291/api/Task/ReceiveTask, + if (respon != null) + { + WebResponseContent respone = JsonConvert.DeserializeObject<WebResponseContent>(respon.ToString()); + if (respone.Status) + { + _unitOfWorkManage.CommitTran(); //鎻愪氦浜嬪姟 + content.OK($"杞﹁疆鍑哄簱浠诲姟涓嬪彂缁橶CS鎴愬姛."); + } + else + { + _unitOfWorkManage.RollbackTran(); //鍥炴粴浜嬪姟 + content.Error($"杞﹁疆鍑哄簱浠诲姟涓嬪彂缁橶CS澶辫触,鍘熷洜 => {content.Message}"); + } + } + else + { + _unitOfWorkManage.RollbackTran(); //鍥炴粴浜嬪姟 + throw new Exception("WCS澶勭悊澶辫触"); + } + return content; + } + else + { + _unitOfWorkManage.RollbackTran(); //鍥炴粴浜嬪姟 + return content.Error("鏈壘鍒板彲鍖归厤鐨勫嚭搴撹溅杞�,杞﹀瀷锛�" + Cartype); + } + } + catch (Exception ex) + { + _unitOfWorkManage.RollbackTran(); + return content.Error($"涓婃灦澶辫触:{ex.Message}"); + } + } + + private Dt_Task CreateOutTask(Dt_WheelsStock wheelsStock, string CZTM) + { + CheckInfo checkInfo = new CheckInfo() + { + CarType = wheelsStock.Wheels_CarType, + MTType = wheelsStock.Wheels_mttype, + CheckType = wheelsStock.Wheels_Type == "1" ? "1" : "2", + HubLevel = wheelsStock.Wheels_level.Contains("绛夌骇") ? wheelsStock.Wheels_level.Replace("绛夌骇", "") : "0", + CLTM = wheelsStock.Wheels_Num, + IsCheck = true, + Standards = wheelsStock.Wheels_NewOrOld + }; + + + Dt_Task task = new Dt_Task() + { + IsCheck = true, + CreateDate = DateTime.Now, + CarType = wheelsStock.Wheels_CarType, + wheels_gkcc = wheelsStock.Wheels_gkcc, + Grade = 1, + CurrentAddress = wheelsStock.Wheels_Location, + SourceAddress = wheelsStock.Wheels_Location, + Creater = "System", + Dispatchertime = DateTime.Now, + PalletCode = wheelsStock.Wheels_Num, + Roadway = "SC1", + TaskNum = _taskRepository.GetTaskNo().Result, + NextAddress = "2010", + TargetAddress = "2021", + TaskState = (int)TaskOutStatusEnum.OutNew, + TaskType = (int)TaskOutboundTypeEnum.OutWheels, + task_CZInfo = CZTM, + task_bak1 = JsonConvert.SerializeObject(checkInfo), + WheelsLX = wheelsStock.Wheels_ldxh, + wheels_mttype = wheelsStock.Wheels_mttype, + WheelsNewOrOld = wheelsStock.Wheels_NewOrOld + }; + return task; + } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/ToAPP/Partial/SaveZDPInfo.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/ToAPP/Partial/SaveZDPInfo.cs" new file mode 100644 index 0000000..f4bd44e --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/ToAPP/Partial/SaveZDPInfo.cs" @@ -0,0 +1,131 @@ +锘� +using Masuit.Tools; +using Newtonsoft.Json; +using System.Text.Json.Nodes; +using System.Xml.Serialization; +using WIDESEA.Common; +using WIDESEA_Common; +using WIDESEA_Common.ZY; +using WIDESEA_Core; +using WIDESEA_Core.Helper; +using WIDESEA_Model.Models; + +namespace WIDESEA_StoragIntegrationServices +{ + public partial class ToAPPService + { + /// <summary> + /// 淇濆瓨鍒跺姩鐩樻暟鎹� + /// </summary> + /// <param name="saveModel"></param> + /// <returns></returns> + public WebResponseContent SaveZDPInfo(SaveModel saveModel) + { + WebResponseContent content = new WebResponseContent(); + try + { + //濡傚綋鍓嶅瓨鍦ㄦ湭寮�濮嬪叆搴撶殑杞﹁疆鎴栧埗鍔ㄧ洏鏁版嵁,鍒欑姝繚瀛樻柊鏁版嵁 浠ラ槻鏁版嵁娣蜂贡 + var waitInbound = _InWheels_MesRepository.QueryFirst(x => x.Wheels_CurrentStatue == "0"); + if (waitInbound != null) throw new Exception("褰撳墠瀛樺湪鏈紑濮嬪叆搴撶殑杞﹁疆鎴栧埗鍔ㄧ洏,璇峰厛鍏ュ簱鍚庡啀淇濆瓨淇℃伅!"); + + //杞﹁疆鐮� + string clCode = saveModel.MainData["code"].ToString(); + if (string.IsNullOrEmpty(clCode)) + throw new Exception($"杞﹁疆鏉$爜涓嶈兘涓虹┖"); + + var clinfo = _InWheels_MesRepository.QueryFirst(x => x.Wheels_code == clCode); + if (clinfo != null) throw new Exception("杞﹁疆褰曞叆淇℃伅宸插瓨鍦�"); + + //妫�娴嬪簱瀛樻槸鍚﹀凡瀛樺湪 + _WheelsStockRepository.QueryFirst(x => x.Wheels_code == clCode); + if (clinfo != null) throw new Exception("搴撳唴宸插瓨鍦�,璇锋鏌ュ簱瀛�"); + + //搴忓垪鍙� + //string madeUnit = saveModel.MainData["xlh"].ToString(); + //杞﹁疆鍙� + string clh = saveModel.MainData["clh"].ToString(); + //杞鏉$爜 + string ldtm = saveModel.MainData["ldtm"].ToString(); + //杞﹀瀷 + string Cartype = saveModel.MainData["chexing"].ToString(); + //閰嶅睘灞� + string psj = saveModel.MainData["psj"].ToString(); + //杞︾粍鍙� + string lcch = saveModel.MainData["lcch"].ToString(); + //鏂版棫 + string newOrOld = saveModel.MainData["neworold"].ToString(); + //杞鍙� + string ldh = saveModel.MainData["ldh"].ToString(); + //杞鍨嬪彿 + string ldxh = saveModel.MainData["ldxh"].ToString(); + //姣傚瓟绛夌骇 + string gkdj = saveModel.MainData["gkdj"].ToString(); + //姣傚瓟a鐣岄潰鍧囧�� + string gkzja = saveModel.MainData["gkzja"].ToString(); + //姣傚瓟b鐣岄潰鍧囧�� + string gkzjb = saveModel.MainData["gkzjb"].ToString(); + //姣傚瓟c鐣岄潰鍧囧�� + string gkzjc = saveModel.MainData["gkzjc"].ToString(); + //杞緞鍊� + string ljz = saveModel.MainData["ljz"].ToString(); + //棰勪及杞緞鍊� + string yglj = saveModel.MainData["yglj"].ToString(); + //鍏ュ簱鏃堕棿 + string rksj = saveModel.MainData["rksj"].ToString(); + //灞炴�� + string WheelsProps = saveModel.MainData["clsx"].ToString(); + //鍔ㄦ嫋灞炴�� + string mttype = saveModel.MainData["mttype"].ToString(); + //姣傚瓟鍧囧�� + string gkcc = saveModel.MainData["gkcc"].ToString(); + + //鍒涘缓浜� + //string user = saveModel.MainData["user"].ToString(); + + + Dt_InWheels_mes wheels_Mes = new Dt_InWheels_mes + { + Wheels_code = clCode, + Wheels_Type = "1", + Wheels_Num = clh, + CreateDate = DateTime.Now, + Creater = "admin", + WheelsProps = WheelsProps, + Wheels_CarNo = lcch, + Wheels_CarType = Cartype, + Wheels_ldxh = ldxh, + Wheels_CurrentStatue = "0", + Wheels_ldtm = ldtm, + Wheels_InDate = rksj, + Wheels_level = gkdj, + Wheels_NewOrOld = newOrOld, + Wheels_psj = psj, + Wheels_gkcc = gkcc, + Wheels_gkzja = gkzja, + Wheels_gkzjb = gkzjb, + Wheels_gkzjc = gkzjc, + Wheels_ldh = ldh, + Wheels_ljz = ljz, + Wheels_mttype = mttype, + //Wheels_SequenceNum = "", + Wheels_ygljz = yglj, + }; + + if (_InWheels_MesRepository.AddData(wheels_Mes) > 0) + { + return content.OK("淇濆瓨鎴愬姛"); + } + else + { + return content.Error("淇濆瓨澶辫触"); + } + } + catch (Exception ex) + { + return content.Error($"{ex.Message}"); + } + + } + + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/ToAPP/ToAPPService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/ToAPP/ToAPPService.cs" new file mode 100644 index 0000000..13b03fa --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/ToAPP/ToAPPService.cs" @@ -0,0 +1,45 @@ +锘縰sing LogLibrary.Log; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Core.BaseRepository; +using WIDESEA_IBusinessesRepository; +using WIDESEA_IServices; +using WIDESEA_IStorageBasicRepository; +using WIDESEA_IStorageBasicService; +using WIDESEA_IStorageTaskRepository; +using WIDESEA_IStoragIntegrationServices; +using WIDESEA_Repository; +using WIDESEAWCS_BasicInfoRepository; + +namespace WIDESEA_StoragIntegrationServices +{ + public partial class ToAPPService : IToAPPService + { + private readonly ILocationInfoRepository _locationRepository; + private readonly IDt_TaskRepository _taskRepository; + private readonly ISys_ConfigService _configService; + private readonly LogFactory LogFactory = new LogFactory(); + private readonly IDt_InWheels_mesRepository _InWheels_MesRepository; + private readonly IDt_WheelsStockRepository _WheelsStockRepository; + private readonly IDt_SelectionStandardsRepository _SelectionStandardsRepository; + private readonly IDt_WheelsStockService _WheelsStockService; + private readonly IDt_CZInfo_mesRepository _CZInfo_MesRepository; + private readonly IUnitOfWorkManage _unitOfWorkManage; + + public ToAPPService(ILocationInfoRepository locationRepository, IDt_TaskRepository taskRepository, ISys_ConfigService configService, IDt_InWheels_mesRepository inWheels_MesRepository, IDt_WheelsStockRepository wheelsStockRepository, IDt_SelectionStandardsRepository selectionStandardsRepository, IDt_WheelsStockService wheelsStockService, IDt_CZInfo_mesRepository cZInfo_MesRepository, IUnitOfWorkManage unitOfWorkManage) + { + _InWheels_MesRepository = inWheels_MesRepository; + _locationRepository = locationRepository; + _taskRepository = taskRepository; + _configService = configService; + _WheelsStockRepository = wheelsStockRepository; + _SelectionStandardsRepository = selectionStandardsRepository; + _WheelsStockService = wheelsStockService; + _CZInfo_MesRepository = cZInfo_MesRepository; + _unitOfWorkManage = unitOfWorkManage; + } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/ToCheckEquip/Partial/GetCheckInfo.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/ToCheckEquip/Partial/GetCheckInfo.cs" new file mode 100644 index 0000000..c778623 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/ToCheckEquip/Partial/GetCheckInfo.cs" @@ -0,0 +1,118 @@ +锘縰sing Masuit.Tools; +using Newtonsoft.Json; +using OfficeOpenXml.Drawing.Chart; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA.Common; +using WIDESEA_Common; +using WIDESEA_Common.ZY; +using WIDESEA_Core; +using WIDESEA_Core.Enums; +using WIDESEA_Model.Models; + +namespace WIDESEA_StoragIntegrationServices +{ + public partial class ToCheckService + { + public WebResponseContent GetCheckInfo(object jsondata) + { + WebResponseContent content = new WebResponseContent(); + try + { + //RequsetMsg requsetMsg = JsonConvert.DeserializeObject<RequsetMsg>(jsondata.ToString()); + + //string cltm = requsetMsg.CLTM; + //if (string.IsNullOrEmpty(cltm)) throw new Exception("璇锋眰杞﹁疆鍙蜂笉鑳戒负绌�"); + + Dt_Task task = _taskRepository.QueryFirst(x => /*x.PalletCode == cltm &&*/ x.TaskState == (int)TaskOutStatusEnum.Lien_Check); + + if (task == null) throw new Exception("鏈煡璇㈠埌浠诲姟"); + + if (!string.IsNullOrEmpty(task.task_bak1)) + { + CheckInfo checkInfo = JsonConvert.DeserializeObject<CheckInfo>(task.task_bak1); + + LogFactory.GetLog("娴嬮噺璁惧鑾峰彇杞洏鏁版嵁").Info(true, $"\r\r--------------------------------------"); + LogFactory.GetLog("娴嬮噺璁惧鑾峰彇杞洏鏁版嵁").Info(true, checkInfo.ToJsonString()); + + return content.OK(data: checkInfo); + } + else + { + string ipaddress = ZY_Interface + "/getCLInfostring"; + + CLInfo Info = new CLInfo { cltm = task.PalletCode }; + + var dic = Info.ToDictionary(); + + var responStr = HttpsClient.PostXml(ipaddress, dic); + + //CLInfo_ZY info = JsonConvert.DeserializeObject<CLInfo_ZY>(responStr); + + CLInfo_ZY inf2o = XMLSerializationTool.DeserializeXmlToObject<CLInfo_ZY>(responStr); + + if (inf2o.FLAG != "S") throw new Exception($"鏅虹菠鎺ュ彛杩斿洖澶辫触:{inf2o.ERROR}"); + + //CheckInfo checkInfo = new CheckInfo() + //{ + // CarType = "CR400AF", + // MTType = "M", + // CheckType = "1", + // HubLevel = "绛夌骇1", + // CLTM = task.PalletCode, + // IsCheck = true, + // Standards = "1" + //}; + string checkType = ""; + + if (task.TaskType == (int)TaskOutboundTypeEnum.OutWheels) + { + if (task.wheels_mttype == "M") + checkType = "1"; + else + checkType = "2"; + } + else if (task.TaskType == (int)TaskOutboundTypeEnum.OutBrake) + { + checkType = "3"; + } + + + CheckInfo checkInfo = new CheckInfo() + { + CarType = inf2o.CHEXING, + MTType = inf2o.MTTYPE, + CheckType = checkType, + HubLevel = inf2o.GKDJ, + CLTM = task.PalletCode, + IsCheck = task.IsCheck, + Standards = inf2o.NEWOLD + }; + LogFactory.GetLog("娴嬮噺璁惧鑾峰彇杞洏鏁版嵁").Info(true, $"\r\r--------------------------------------"); + LogFactory.GetLog("娴嬮噺璁惧鑾峰彇杞洏鏁版嵁").Info(true, checkInfo.ToJsonString()); + return content.OK(data: checkInfo); + } + } + catch (Exception ex) + { + LogFactory.GetLog("娴嬮噺璁惧鑾峰彇杞洏鏁版嵁").Info(true, $"\r\r--------------------------------------"); + LogFactory.GetLog("娴嬮噺璁惧鑾峰彇杞洏鏁版嵁").Info(true, ex.Message); + return content.Error($"鑾峰彇娴嬮噺淇℃伅澶辫触:{ex.Message}"); + } + } + + //private string GetCheckType(TaskOutboundTypeEnum tasktype, string mtType) + //{ + // switch (TaskOutboundTypeEnum) + // { + // case + // TaskOutboundTypeEnum.OutWheels: + // default: + // break; + // } + //} + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/ToCheckEquip/Partial/UploadCheckResult.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/ToCheckEquip/Partial/UploadCheckResult.cs" new file mode 100644 index 0000000..e27e021 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/ToCheckEquip/Partial/UploadCheckResult.cs" @@ -0,0 +1,86 @@ +锘縰sing MailKit; +using Mapster; +using Masuit.Tools; +using Masuit.Tools.Security; +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Common; +using WIDESEA_Core; +using WIDESEA_Core.Enums; +using WIDESEA_IStoragIntegrationServices; +using WIDESEA_Model.Models; +using WIDESEA_StorageTaskRepository; + +namespace WIDESEA_StoragIntegrationServices +{ + public partial class ToCheckService + { + /// <summary> + /// 鎺ュ彈骞朵笂浼犳櫤绮ゆ祴閲忚澶囩粨鏋滄暟鎹� + /// </summary> + /// <param name="jsondata"></param> + /// <returns></returns> + public WebResponseContent UploadCheckResult(object jsondata) + { + WebResponseContent content = new WebResponseContent(); + try + { + if (jsondata == null) throw new Exception("鏁版嵁涓虹┖"); + + CheckResult checkResult = JsonConvert.DeserializeObject<CheckResult>(jsondata.ToString()); + + Dt_Task task = _taskRepository.QueryFirst(x => x.PalletCode == checkResult.CLTM && x.TaskState == (int)TaskOutStatusEnum.Lien_Check); + + if (task == null) throw new Exception("鏈煡璇㈠埌杞﹁疆浠诲姟"); + + task.TaskState = (int)TaskOutStatusEnum.Lien_CheckFinish; //娴嬮噺瀹屾垚鍚庡皢浠诲姟鍒犻櫎 + + + var taskHty = task.Adapt<Dt_Task_Hty>(); + taskHty.FinishTime = DateTime.Now; + taskHty.OperateType = (int)OperateTypeEnum.鑷姩瀹屾垚; + + + Dt_CheckResult result = new Dt_CheckResult(); + + checkResult.Adapt(result); + + //result.CreateDate = DateTime.Now; + //result.Creater = "CK"; + + // 涓婁紶鏅虹菠 涓婁紶鎴愬姛鍚庢爣璁版垚鍔�,澶辫触鍒欎笉绠″悗缁汉宸ュ彲琛ュ綍 + if (_toZYService.ReportToSCE(result).Status) + { + result.IsUploadMES = true; + } + + result.InDate = DateTime.Now; + + + LogFactory.GetLog("娴嬮噺璁惧涓婁紶娴嬮噺缁撴灉鏁版嵁").Info(true, $"\r\r--------------------------------------"); + LogFactory.GetLog("娴嬮噺璁惧涓婁紶娴嬮噺缁撴灉鏁版嵁").Info(true, result.ToJsonString()); + if (_checkResultRepository.AddData(result) > 0) + { + _taskRepository.DeleteData(task); + _task_HtyRepository.AddData(taskHty); + return content.OK(); + } + else + { + return content.Error(); + } + + } + catch (Exception ex) + { + LogFactory.GetLog("娴嬮噺璁惧涓婁紶娴嬮噺缁撴灉鏁版嵁").Info(true, $"\r\r--------------------------------------"); + LogFactory.GetLog("娴嬮噺璁惧涓婁紶娴嬮噺缁撴灉鏁版嵁").Info(true, ex.Message); + return content.Error($"璇锋眰寮傚父锛歿ex.Message}"); + } + } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/ToCheckEquip/ToCheckService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/ToCheckEquip/ToCheckService.cs" new file mode 100644 index 0000000..4eb3925 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/ToCheckEquip/ToCheckService.cs" @@ -0,0 +1,45 @@ +锘縰sing LogLibrary.Log; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_IBusinessesRepository; +using WIDESEA_IServices; +using WIDESEA_IStorageBasicRepository; +using WIDESEA_IStorageTaskRepository; +using WIDESEA_IStoragIntegrationServices; +using WIDESEA_Repository; +using WIDESEAWCS_BasicInfoRepository; + +namespace WIDESEA_StoragIntegrationServices +{ + public partial class ToCheckService : IToCheckService + { + private readonly ILocationInfoRepository _locationRepository; + private readonly IDt_TaskRepository _taskRepository; + private readonly IStockInfoRepository _stockInfoRepository; + private readonly ISys_ConfigService _configService; + private readonly IDt_StationManagerRepository _stationManagerRepository; + private readonly IDt_AreaInfoRepository _areaInfoRepository; + private readonly IDt_CheckResultRepository _checkResultRepository; + private readonly IToZYService _toZYService; + private readonly IDt_Task_HtyRepository _task_HtyRepository; + private readonly LogFactory LogFactory = new LogFactory(); + + public static string ZY_Interface = "http://172.21.1.117/barcode/Webservice/WebService_ZY/WebServiceZY.asmx"; + + public ToCheckService(ILocationInfoRepository locationRepository,IDt_TaskRepository taskRepository, IStockInfoRepository stockInfoRepository, ISys_ConfigService configService, IDt_StationManagerRepository stationManagerRepository, IDt_AreaInfoRepository dt_AreaInfoRepository, IDt_CheckResultRepository checkResultRepository, IToZYService toZYService , IDt_Task_HtyRepository task_HtyRepository) + { + _locationRepository = locationRepository; + _taskRepository = taskRepository; + _stockInfoRepository = stockInfoRepository; + _configService = configService; + _stationManagerRepository = stationManagerRepository; + _areaInfoRepository = dt_AreaInfoRepository; + _checkResultRepository = checkResultRepository; + _toZYService = toZYService; + _task_HtyRepository = task_HtyRepository; + } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/WCS/Partial/CallPalletCode.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/WCS/Partial/CallPalletCode.cs" new file mode 100644 index 0000000..8d34b31 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/WCS/Partial/CallPalletCode.cs" @@ -0,0 +1,59 @@ +锘縰sing Microsoft.AspNetCore.Mvc; +using System; +using System.CodeDom; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Core; +using WIDESEA_Core.Enums; +using WIDESEA_DTO; +using WIDESEA_DTO.WMS; +using WIDESEA_Model.Models; +namespace WIDESEA_StoragIntegrationServices +{ + public partial class WCSService + { + public async Task<WebResponseContent> CallPalletCodeAsync(RequestTaskDto json) + { + WebResponseContent content = new WebResponseContent(); + try + { + Dt_WheelsStock stockInfo = _wheelsStockRepository.QueryFirst(X => X.Wheels_Type == "x"); + if (stockInfo == null) throw new Exception("搴撳唴鏃犳弧瓒虫潯浠剁殑搴撳瓨鍙嚭搴�"); + + // 鍒涘缓鏂颁换鍔″疄渚� + //var task = new Dt_Task + //{ + // CurrentAddress = stockInfo.LocationInfo.RoadwayNo, + // Grade = 1, + // Roadway = stockInfo.LocationInfo.RoadwayNo, + // TargetAddress = ToAddress, + // Dispatchertime = DateTime.Now, + // MaterialNo = "", + // NextAddress = ToAddress, + // OrderNo = null, + // PalletCode = input.PalletCode, + // SourceAddress = input.Position, + // TaskState = (int)TaskOutStatusEnum.OutNew, + // TaskType = (int)TaskOutboundTypeEnum.Outbound, + // TaskNum = await _taskRepository.GetTaskNo(), + // Creater = "Systeam" + //}; + + + WMSTaskDTO taskDTO = new WMSTaskDTO() + { + + }; + + + return content.OK(); + } + catch (Exception ex) + { + return content.Error($"澶辫触锛歿ex.Message}"); + } + } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/WCS/Partial/ManualOutboundTask.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/WCS/Partial/ManualOutboundTask.cs" new file mode 100644 index 0000000..a7ea024 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/WCS/Partial/ManualOutboundTask.cs" @@ -0,0 +1,37 @@ +锘縰sing MailKit; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Core; +using WIDESEA_Core.Enums; +using WIDESEA_StorageBasicRepository; + +namespace WIDESEA_StoragIntegrationServices +{ + public partial class WCSService + { + public WebResponseContent ManualOutboundTask(string barcode, string targetAddress) + { + WebResponseContent content = new WebResponseContent(); + try + { + var wheelsInfo = _wheelsStockRepository.QueryFirst(x => x.Wheels_code == barcode); + if (wheelsInfo == null) throw new Exception("鏈壘鍒板簱瀛樹俊鎭�"); + + var locationInfo = _locationRepository.QueryFirst(x => x.LocationCode == wheelsInfo.Wheels_Location); + if (locationInfo.LocationStatus == (int)LocationEnum.Lock) throw new Exception("搴撲綅閿佸畾,绂佹鍑哄簱"); + + + + return content.OK(); + } + catch (Exception ex) + { + return content.Error($"鎸囧畾鍑哄簱寮傚父{ex.Message}"); + } + } + } + +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/WCS/WCSService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/WCS/WCSService.cs" new file mode 100644 index 0000000..867c867 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/WCS/WCSService.cs" @@ -0,0 +1,34 @@ +锘縰sing LogLibrary.Log; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_IServices; +using WIDESEA_IStorageBasicRepository; +using WIDESEA_IStorageTaskRepository; +using WIDESEA_IStoragIntegrationServices; +using WIDESEAWCS_BasicInfoRepository; + +namespace WIDESEA_StoragIntegrationServices +{ + public partial class WCSService : IWCSService + { + private readonly ILocationInfoRepository _locationRepository; + private readonly IDt_TaskRepository _taskRepository; + private readonly ISys_ConfigService _configService; + private readonly IDt_StationManagerRepository _stationManagerRepository; + private readonly IDt_WheelsStockRepository _wheelsStockRepository; + + private readonly LogFactory LogFactory = new LogFactory(); + + public WCSService(ILocationInfoRepository locationRepository,IDt_TaskRepository taskRepository, IDt_WheelsStockRepository wheelsStockRepository, ISys_ConfigService configService, IDt_StationManagerRepository stationManagerRepository) + { + _locationRepository = locationRepository; + _taskRepository = taskRepository; + _wheelsStockRepository = wheelsStockRepository; + _configService = configService; + _stationManagerRepository = stationManagerRepository; + } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/ZY/Partial/ReportToSCE.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/ZY/Partial/ReportToSCE.cs" new file mode 100644 index 0000000..61e8253 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/ZY/Partial/ReportToSCE.cs" @@ -0,0 +1,55 @@ +锘� +using Masuit.Tools; +using Microsoft.IdentityModel.Tokens; +using Newtonsoft.Json; +using WIDESEA.Common; +using WIDESEA_Common; +using WIDESEA_Common.ZY; +using WIDESEA_Core; +using WIDESEA_Core.Helper; +using WIDESEA_Model.Models; + +namespace WIDESEA_StoragIntegrationServices +{ + public partial class ToZYService + { + /// <summary> + /// 涓婁紶娴嬮噺鏁版嵁鑷虫櫤绮� + /// </summary> + /// <param name="">杞﹁疆</param> + /// <returns></returns> + public WebResponseContent ReportToSCE(Dt_CheckResult checkResult) + { + WebResponseContent content = new WebResponseContent(); + try + { + //cltm = "L E1700844 0037"; + + if (string.IsNullOrEmpty(checkResult.CLTM)) throw new Exception("璇锋眰杞﹁酱鍙蜂笉鑳戒负绌�"); + + string ipaddress = ZY_CheckResultInterface + "/ReportToSCE"; + + var dic = checkResult.ToDictionary(); + //dic.Remove("ID"); + //dic.Remove("IsUploadMES"); + + RequestReportToSCE_ZY Info = new RequestReportToSCE_ZY { s_eqptno = "CL", s_source = JsonConvert.SerializeObject(dic) }; + + var infos = Info.ToDictionary(); + + var responStr = HttpsClient.PostXml(ipaddress, infos); + + Basic_ZY result = XMLSerializationTool.DeserializeXmlToObject<Basic_ZY>(responStr); + + if (result.FLAG != "S") throw new Exception($"涓婁紶淇℃伅澶辫触:鏅虹菠鎺ュ彛杩斿洖澶辫触:{result.ERROR}"); + + content.OK(); + } + catch (Exception ex) + { + content.Error("涓婁紶娴嬮噺淇℃伅澶辫触,寮傚父:" + ex.Message); + } + return content; + } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/ZY/Partial/ZY_GetCLInfo.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/ZY/Partial/ZY_GetCLInfo.cs" new file mode 100644 index 0000000..1b0410c --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/ZY/Partial/ZY_GetCLInfo.cs" @@ -0,0 +1,89 @@ +锘� +using Masuit.Tools; +using Newtonsoft.Json; +using WIDESEA.Common; +using WIDESEA_Common; +using WIDESEA_Common.ZY; +using WIDESEA_Core; +using WIDESEA_Core.Helper; + +namespace WIDESEA_StoragIntegrationServices +{ + public partial class ToZYService + { + //public static string ZY_Interface = "http://172.21.1.117/barcode/Webservice/WebService_ZY/WebServiceZY.asmx"; + + //public static string POSTURL = "http://172.21.1.117/barcode/Webservice/WebService_ZY/Service_EQP.asmx"; + /// <summary> + /// 鑾峰彇杞﹁疆淇℃伅鎺ュ彛 + /// </summary> + /// <param name="">杞﹁疆</param> + /// <returns></returns> + public WebResponseContent ZY_GetCLInfo(SaveModel saveModel) + { + WebResponseContent content = new WebResponseContent(); + try + { + string cltm = saveModel.MainData["cltm"].ToString(); + //cltm = "L E1700844 0037"; + + if (string.IsNullOrEmpty(cltm)) throw new Exception("璇锋眰杞﹁疆鍙蜂笉鑳戒负绌�"); + + string ipaddress = ZY_Interface + "/getCLInfostring"; + + CLInfo Info = new CLInfo { cltm = cltm }; + + var dic = Info.ToDictionary(); + + var responStr = HttpsClient.PostXml(ipaddress, dic); + + //CLInfo_ZY info = JsonConvert.DeserializeObject<CLInfo_ZY>(responStr); + + CLInfo_ZY inf2o = XMLSerializationTool.DeserializeXmlToObject<CLInfo_ZY>(responStr); + + if (inf2o.FLAG != "S") throw new Exception($"鑾峰彇淇℃伅澶辫触:鎺ュ彛杩斿洖澶辫触:{inf2o.ERROR}"); + //string info2 = XMLSerializationTool.SerializeObjectToXml<string>(responStr); + + //CLInfo_ZY info_ZY = new CLInfo_ZY() //娴嬭瘯鏁版嵁 + //{ + // //level = "1", + // //InboundDate = "2020-04-10", + // //gkzjjz = "520.11", + // //gkjmz = "421.1", + // //czh = "100", + // //clh = "L E123-52 4A", + // //cartype = "CRH1A", + // //Ltype = "SDA", + // //lx = "DA", + // //mttype = "crh", + // //NewOrOld = "NEW", + // //psj = "鍔ㄨ溅缁�", + // //sx = "da", + // //xlh = "1", + // //ygljz = "121" + //}; + + //inf2o.CHEXING = "CRH1A"; + //inf2o.MTTYPE = "M"; + if (!string.IsNullOrEmpty(inf2o.NEWOLD)) //灏嗘暟瀛楄浆涓烘柊鏃� + { + inf2o.NEWOLD = inf2o.NEWOLD == "1" ? "鏃�" : "鏂�"; + } + + + //CLInfo_ZY info_ZY = XmlToJson(responStr); + + content.OK(data: inf2o); + } + catch (Exception ex) + { + content.Error("鑾峰彇杞﹁疆淇℃伅澶辫触.寮傚父:" + ex.Message); + } + finally + { + //LogRecord.WriteLog((int)LogEnum.Mes, $"缁勭洏鏌ヨ杞存壙淇℃伅缁撴灉锛歿resultString}"); + } + return content; + } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/ZY/Partial/getCZInfo.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/ZY/Partial/getCZInfo.cs" new file mode 100644 index 0000000..3377ee7 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/ZY/Partial/getCZInfo.cs" @@ -0,0 +1,77 @@ +锘� +using Masuit.Tools; +using Newtonsoft.Json; +using WIDESEA.Common; +using WIDESEA_Common; +using WIDESEA_Common.ZY; +using WIDESEA_Core; +using WIDESEA_Core.Helper; + +namespace WIDESEA_StoragIntegrationServices +{ + public partial class ToZYService + { + /// <summary> + /// 鑾峰彇杞﹁酱淇℃伅鎺ュ彛 + /// </summary> + /// <param name="">杞﹁疆</param> + /// <returns></returns> + public WebResponseContent getCZInfo(SaveModel saveModel) + { + WebResponseContent content = new WebResponseContent(); + try + { + string cztm = saveModel.MainData["cztm"].ToString(); + //cltm = "L E1700844 0037"; + + if (string.IsNullOrEmpty(cztm)) throw new Exception("璇锋眰杞﹁酱鏉$爜涓嶈兘涓虹┖"); + + string ipaddress = ZY_Interface + "/getCZInfo"; + + CZinfo Info = new CZinfo { s_barcode = cztm }; + + var dic = Info.ToDictionary(); + + var responStr = HttpsClient.PostXml(ipaddress, dic); + + //CLInfo_ZY info = JsonConvert.DeserializeObject<CLInfo_ZY>(responStr); + + CZInfo_ZY inf2o = XMLSerializationTool.DeserializeXmlToObject<CZInfo_ZY>(responStr); + + if (inf2o.FLAG != "S") throw new Exception($"鑾峰彇淇℃伅澶辫触:鎺ュ彛杩斿洖澶辫触:{inf2o.ERROR}"); + //string info2 = XMLSerializationTool.SerializeObjectToXml<string>(responStr); + + //CLInfo_ZY info_ZY = new CLInfo_ZY() //娴嬭瘯鏁版嵁 + //{ + // //level = "1", + // //InboundDate = "2020-04-10", + // //gkzjjz = "520.11", + // //gkjmz = "421.1", + // //czh = "100", + // //clh = "L E123-52 4A", + // //cartype = "CRH1A", + // //Ltype = "SDA", + // //lx = "DA", + // //mttype = "crh", + // //NewOrOld = "NEW", + // //psj = "鍔ㄨ溅缁�", + // //sx = "da", + // //xlh = "1", + // //ygljz = "121" + //}; + + //inf2o.CHEXING = "CRH1A"; + //inf2o.MTTYPE = "M"; + + //CLInfo_ZY info_ZY = XmlToJson(responStr); + + content.OK(data: inf2o); + } + catch (Exception ex) + { + content.Error("鑾峰彇杞﹁酱淇℃伅澶辫触.寮傚父:" + ex.Message); + } + return content; + } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/ZY/Partial/getZDPInfo.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/ZY/Partial/getZDPInfo.cs" new file mode 100644 index 0000000..91f3c1e --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/ZY/Partial/getZDPInfo.cs" @@ -0,0 +1,81 @@ +锘� +using Masuit.Tools; +using Newtonsoft.Json; +using WIDESEA.Common; +using WIDESEA_Common; +using WIDESEA_Common.ZY; +using WIDESEA_Core; +using WIDESEA_Core.Helper; + +namespace WIDESEA_StoragIntegrationServices +{ + public partial class ToZYService + { + /// <summary> + /// 鑾峰彇鍒跺姩鐩樹俊鎭帴鍙� + /// </summary> + /// <param name="">杞﹁疆</param> + /// <returns></returns> + public WebResponseContent getZDPInfo(SaveModel saveModel) + { + WebResponseContent content = new WebResponseContent(); + try + { + string ZPH = saveModel.MainData["ZPH"].ToString(); + //cltm = "L E1700844 0037"; + + if (string.IsNullOrEmpty(ZPH)) throw new Exception("璇锋眰鍒跺姩鐩樺彿涓嶈兘涓虹┖"); + + string ipaddress = ZY_Interface + "/getzdpInfo"; + + ZDPInfo Info = new ZDPInfo { zdptm = ZPH }; + + var dic = Info.ToDictionary(); + + var responStr = HttpsClient.PostXml(ipaddress, dic); + + //CLInfo_ZY info = JsonConvert.DeserializeObject<CLInfo_ZY>(responStr); + + ZDPInfo_ZY inf2o = XMLSerializationTool.DeserializeXmlToObject<ZDPInfo_ZY>(responStr); + + if (inf2o.FLAG != "S") throw new Exception($"鑾峰彇淇℃伅澶辫触:鎺ュ彛杩斿洖澶辫触:{inf2o.ERROR}"); + //string info2 = XMLSerializationTool.SerializeObjectToXml<string>(responStr); + + //CLInfo_ZY info_ZY = new CLInfo_ZY() //娴嬭瘯鏁版嵁 + //{ + // //level = "1", + // //InboundDate = "2020-04-10", + // //gkzjjz = "520.11", + // //gkjmz = "421.1", + // //czh = "100", + // //clh = "L E123-52 4A", + // //cartype = "CRH1A", + // //Ltype = "SDA", + // //lx = "DA", + // //mttype = "crh", + // //NewOrOld = "NEW", + // //psj = "鍔ㄨ溅缁�", + // //sx = "da", + // //xlh = "1", + // //ygljz = "121" + //}; + + //inf2o.CHEXING = "CRH1A"; + //inf2o.MTTYPE = "M"; + + //CLInfo_ZY info_ZY = XmlToJson(responStr); + + content.OK(data: inf2o); + } + catch (Exception ex) + { + content.Error("鑾峰彇鍒跺姩鐩樹俊鎭け璐�.寮傚父:" + ex.Message); + } + finally + { + //LogRecord.WriteLog((int)LogEnum.Mes, $"缁勭洏鏌ヨ杞存壙淇℃伅缁撴灉锛歿resultString}"); + } + return content; + } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/ZY/ToZYService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/ZY/ToZYService.cs" new file mode 100644 index 0000000..d564660 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/ZY/ToZYService.cs" @@ -0,0 +1,43 @@ +锘縰sing LogLibrary.Log; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_IBusinessesRepository; +using WIDESEA_IServices; +using WIDESEA_IStorageBasicRepository; +using WIDESEA_IStorageTaskRepository; +using WIDESEA_IStoragIntegrationServices; +using WIDESEA_Repository; +using WIDESEAWCS_BasicInfoRepository; + +namespace WIDESEA_StoragIntegrationServices +{ + public partial class ToZYService : IToZYService + { + private readonly ILocationInfoRepository _locationRepository; + private readonly IDt_TaskRepository _taskRepository; + private readonly IStockInfoRepository _stockInfoRepository; + private readonly ISys_ConfigService _configService; + private readonly IDt_StationManagerRepository _stationManagerRepository; + private readonly IDt_AreaInfoRepository _areaInfoRepository; + private readonly LogFactory LogFactory = new LogFactory(); + + public static string ZY_Interface = "http://172.21.1.117/barcode/Webservice/WebService_ZY/WebServiceZY.asmx"; + + public static string ZY_CheckResultInterface = "http://172.21.1.117/barcode/Webservice/WebService_ZY/Service_EQP.asmx"; + + + + public ToZYService(ILocationInfoRepository locationRepository,IDt_TaskRepository taskRepository,IStockInfoRepository stockInfoRepository, ISys_ConfigService configService, IDt_StationManagerRepository stationManagerRepository,IDt_AreaInfoRepository dt_AreaInfoRepository) + { + _locationRepository = locationRepository; + _taskRepository = taskRepository; + _stockInfoRepository = stockInfoRepository; + _configService = configService; + _stationManagerRepository = stationManagerRepository; + _areaInfoRepository = dt_AreaInfoRepository; + } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicRepository/BasicInfo/Dt_SelectionStandardsRepository.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicRepository/BasicInfo/Dt_SelectionStandardsRepository.cs" new file mode 100644 index 0000000..c65b2ca --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicRepository/BasicInfo/Dt_SelectionStandardsRepository.cs" @@ -0,0 +1,28 @@ +锘�#region << 鐗� 鏈� 娉� 閲� >> +/*---------------------------------------------------------------- + * 鍛藉悕绌洪棿锛歐IDESEAWCS_TaskInfoRepository + * 鍒涘缓鑰咃細鑳$搴� + * 鍒涘缓鏃堕棿锛�2024/8/2 16:13:36 + * 鐗堟湰锛歏1.0.0 + * 鎻忚堪锛� + * + * ---------------------------------------------------------------- + * 淇敼浜猴細 + * 淇敼鏃堕棿锛� + * 鐗堟湰锛歏1.0.1 + * 淇敼璇存槑锛� + * + *----------------------------------------------------------------*/ +#endregion << 鐗� 鏈� 娉� 閲� >> + +using WIDESEAWCS_Model.Models; + +namespace WIDESEAWCS_BasicInfoRepository +{ + public class Dt_SelectionStandardsRepository : RepositoryBase<Dt_SelectionStandards>, IDt_SelectionStandardsRepository + { + public Dt_SelectionStandardsRepository(IUnitOfWorkManage unitOfWorkManage) : base(unitOfWorkManage) + { + } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicRepository/BasicInfo/Dt_StationManagerRepository.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicRepository/BasicInfo/Dt_StationManagerRepository.cs" new file mode 100644 index 0000000..e585382 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicRepository/BasicInfo/Dt_StationManagerRepository.cs" @@ -0,0 +1,28 @@ +锘�#region << 鐗� 鏈� 娉� 閲� >> +/*---------------------------------------------------------------- + * 鍛藉悕绌洪棿锛歐IDESEAWCS_TaskInfoRepository + * 鍒涘缓鑰咃細鑳$搴� + * 鍒涘缓鏃堕棿锛�2024/8/2 16:13:36 + * 鐗堟湰锛歏1.0.0 + * 鎻忚堪锛� + * + * ---------------------------------------------------------------- + * 淇敼浜猴細 + * 淇敼鏃堕棿锛� + * 鐗堟湰锛歏1.0.1 + * 淇敼璇存槑锛� + * + *----------------------------------------------------------------*/ +#endregion << 鐗� 鏈� 娉� 閲� >> + +using WIDESEAWCS_Model.Models; + +namespace WIDESEAWCS_BasicInfoRepository +{ + public class Dt_StationManagerRepository : RepositoryBase<Dt_StationManager>, IDt_StationManagerRepository + { + public Dt_StationManagerRepository(IUnitOfWorkManage unitOfWorkManage) : base(unitOfWorkManage) + { + } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicRepository/BasicInfo/Dt_TraintypeRepository.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicRepository/BasicInfo/Dt_TraintypeRepository.cs" new file mode 100644 index 0000000..12dddd0 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicRepository/BasicInfo/Dt_TraintypeRepository.cs" @@ -0,0 +1,28 @@ +锘�#region << 鐗� 鏈� 娉� 閲� >> +/*---------------------------------------------------------------- + * 鍛藉悕绌洪棿锛歐IDESEAWCS_TaskInfoRepository + * 鍒涘缓鑰咃細鑳$搴� + * 鍒涘缓鏃堕棿锛�2024/8/2 16:13:36 + * 鐗堟湰锛歏1.0.0 + * 鎻忚堪锛� + * + * ---------------------------------------------------------------- + * 淇敼浜猴細 + * 淇敼鏃堕棿锛� + * 鐗堟湰锛歏1.0.1 + * 淇敼璇存槑锛� + * + *----------------------------------------------------------------*/ +#endregion << 鐗� 鏈� 娉� 閲� >> + +using WIDESEAWCS_Model.Models; + +namespace WIDESEAWCS_BasicInfoRepository +{ + public class Dt_TraintypeRepository : RepositoryBase<Dt_Traintype>, IDt_TraintypeRepository + { + public Dt_TraintypeRepository(IUnitOfWorkManage unitOfWorkManage) : base(unitOfWorkManage) + { + } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicRepository/BasicInfo/Dt_needBarcodeRepository.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicRepository/BasicInfo/Dt_needBarcodeRepository.cs" new file mode 100644 index 0000000..af6b2d3 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicRepository/BasicInfo/Dt_needBarcodeRepository.cs" @@ -0,0 +1,28 @@ +锘�#region << 鐗� 鏈� 娉� 閲� >> +/*---------------------------------------------------------------- + * 鍛藉悕绌洪棿锛歐IDESEAWCS_TaskInfoRepository + * 鍒涘缓鑰咃細鑳$搴� + * 鍒涘缓鏃堕棿锛�2024/8/2 16:13:36 + * 鐗堟湰锛歏1.0.0 + * 鎻忚堪锛� + * + * ---------------------------------------------------------------- + * 淇敼浜猴細 + * 淇敼鏃堕棿锛� + * 鐗堟湰锛歏1.0.1 + * 淇敼璇存槑锛� + * + *----------------------------------------------------------------*/ +#endregion << 鐗� 鏈� 娉� 閲� >> + +using WIDESEAWCS_Model.Models; + +namespace WIDESEAWCS_BasicInfoRepository +{ + public class Dt_needBarcodeRepository : RepositoryBase<dt_needBarcode>, IDt_needBarcodeRepository + { + public Dt_needBarcodeRepository(IUnitOfWorkManage unitOfWorkManage) : base(unitOfWorkManage) + { + } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicRepository/Boxing/BoxingInfoDetailRepository.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicRepository/Boxing/BoxingInfoDetailRepository.cs" new file mode 100644 index 0000000..4fb03d2 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicRepository/Boxing/BoxingInfoDetailRepository.cs" @@ -0,0 +1,9 @@ +锘縩amespace WIDESEA_StorageBasicRepository +{ + public class BoxingInfoDetailRepository : RepositoryBase<DtBoxingInfoDetail>, IBoxingInfoDetailRepository + { + public BoxingInfoDetailRepository(IUnitOfWorkManage unitOfWorkManage) : base(unitOfWorkManage) + { + } + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicRepository/Boxing/BoxingInfoRepository.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicRepository/Boxing/BoxingInfoRepository.cs" new file mode 100644 index 0000000..c9a9585 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicRepository/Boxing/BoxingInfoRepository.cs" @@ -0,0 +1,9 @@ +锘縩amespace WIDESEA_StorageBasicRepository +{ + public class BoxingInfoRepository : RepositoryBase<DtBoxingInfo>, IBoxingInfoRepository + { + public BoxingInfoRepository(IUnitOfWorkManage unitOfWorkManage) : base(unitOfWorkManage) + { + } + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicRepository/Boxing/Dt_CZInfo_mesRepository.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicRepository/Boxing/Dt_CZInfo_mesRepository.cs" new file mode 100644 index 0000000..f67baad --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicRepository/Boxing/Dt_CZInfo_mesRepository.cs" @@ -0,0 +1,9 @@ +锘縩amespace WIDESEA_StorageBasicRepository +{ + public class Dt_CZInfo_mesRepository : RepositoryBase<Dt_CZInfo_mes>, IDt_CZInfo_mesRepository + { + public Dt_CZInfo_mesRepository(IUnitOfWorkManage unitOfWorkManage) : base(unitOfWorkManage) + { + } + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicRepository/Boxing/Dt_CZInfo_mes_htyRepository.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicRepository/Boxing/Dt_CZInfo_mes_htyRepository.cs" new file mode 100644 index 0000000..b727a07 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicRepository/Boxing/Dt_CZInfo_mes_htyRepository.cs" @@ -0,0 +1,9 @@ +锘縩amespace WIDESEA_StorageBasicRepository +{ + public class Dt_CZInfo_mes_htyRepository : RepositoryBase<Dt_CZInfo_mes_hty>, IDt_CZInfo_mes_htyRepository + { + public Dt_CZInfo_mes_htyRepository(IUnitOfWorkManage unitOfWorkManage) : base(unitOfWorkManage) + { + } + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicRepository/Boxing/Dt_InWheels_mesRepository.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicRepository/Boxing/Dt_InWheels_mesRepository.cs" new file mode 100644 index 0000000..b5b71b0 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicRepository/Boxing/Dt_InWheels_mesRepository.cs" @@ -0,0 +1,9 @@ +锘縩amespace WIDESEA_StorageBasicRepository +{ + public class Dt_InWheels_mesRepository : RepositoryBase<Dt_InWheels_mes>, IDt_InWheels_mesRepository + { + public Dt_InWheels_mesRepository(IUnitOfWorkManage unitOfWorkManage) : base(unitOfWorkManage) + { + } + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicRepository/Boxing/Dt_InWheels_mes_htyRepository.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicRepository/Boxing/Dt_InWheels_mes_htyRepository.cs" new file mode 100644 index 0000000..a65b7b3 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicRepository/Boxing/Dt_InWheels_mes_htyRepository.cs" @@ -0,0 +1,9 @@ +锘縩amespace WIDESEA_StorageBasicRepository +{ + public class Dt_InWheels_mes_htyRepository : RepositoryBase<Dt_InWheels_mes_hty>, IDt_InWheels_mes_htyRepository + { + public Dt_InWheels_mes_htyRepository(IUnitOfWorkManage unitOfWorkManage) : base(unitOfWorkManage) + { + } + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicRepository/CacheInfo/Dt_CacheInfoRepository.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicRepository/CacheInfo/Dt_CacheInfoRepository.cs" new file mode 100644 index 0000000..1fe7a1d --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicRepository/CacheInfo/Dt_CacheInfoRepository.cs" @@ -0,0 +1,9 @@ +锘縩amespace WIDESEA_StorageBasicRepository +{ + public class Dt_CacheInfoRepository : RepositoryBase<Dt_CacheInfo>, IDt_CacheInfoRepository + { + public Dt_CacheInfoRepository(IUnitOfWorkManage unitOfWorkManage) : base(unitOfWorkManage) + { + } + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicRepository/CacheInfo/Dt_CacheInfo_htyRepository.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicRepository/CacheInfo/Dt_CacheInfo_htyRepository.cs" new file mode 100644 index 0000000..96d96c8 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicRepository/CacheInfo/Dt_CacheInfo_htyRepository.cs" @@ -0,0 +1,9 @@ +锘縩amespace WIDESEA_StorageBasicRepository +{ + public class Dt_CacheInfo_htyRepository : RepositoryBase<Dt_CacheInfo_hty>, IDt_CacheInfo_htyRepository + { + public Dt_CacheInfo_htyRepository(IUnitOfWorkManage unitOfWorkManage) : base(unitOfWorkManage) + { + } + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicRepository/Check/Dt_CheckResultRepository.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicRepository/Check/Dt_CheckResultRepository.cs" new file mode 100644 index 0000000..2799cef --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicRepository/Check/Dt_CheckResultRepository.cs" @@ -0,0 +1,9 @@ +锘縩amespace WIDESEA_StorageBasicRepository +{ + public class Dt_CheckResultRepository : RepositoryBase<Dt_CheckResult>, IDt_CheckResultRepository + { + public Dt_CheckResultRepository(IUnitOfWorkManage unitOfWorkManage) : base(unitOfWorkManage) + { + } + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicRepository/GlobalUsing.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicRepository/GlobalUsing.cs" new file mode 100644 index 0000000..592a47f --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicRepository/GlobalUsing.cs" @@ -0,0 +1,3 @@ +锘縢lobal using WIDESEA_Core.BaseRepository; +global using WIDESEA_Model.Models; +global using WIDESEA_IStorageBasicRepository; \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicRepository/Location/LocationInfoRepository.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicRepository/Location/LocationInfoRepository.cs" new file mode 100644 index 0000000..ebcb987 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicRepository/Location/LocationInfoRepository.cs" @@ -0,0 +1,9 @@ +锘縩amespace WIDESEA_StorageBasicRepository +{ + public class LocationInfoRepository : RepositoryBase<DtLocationInfo>, ILocationInfoRepository + { + public LocationInfoRepository(IUnitOfWorkManage unitOfWorkManage) : base(unitOfWorkManage) + { + } + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicRepository/Location/LocationStatusChangeRecordRepository.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicRepository/Location/LocationStatusChangeRecordRepository.cs" new file mode 100644 index 0000000..f91b37d --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicRepository/Location/LocationStatusChangeRecordRepository.cs" @@ -0,0 +1,92 @@ +锘縰sing WIDESEA_Core; +using WIDESEA_DTO; +using WIDESEA_Model.Models; + +namespace WIDESEA_StorageBasicRepository +{ + public class LocationStatusChangeRecordRepository : RepositoryBase<DtLocationStatusChangeRecord>, ILocationStatusChangeRecordRepository + { + public LocationStatusChangeRecordRepository(IUnitOfWorkManage unitOfWorkManage) : base(unitOfWorkManage) + { + } + + /// <summary> + /// 娣诲姞璐т綅鍙樺姩璁板綍 + /// </summary> + /// <param name="changeRecordDto">鏁版嵁妯″瀷</param> + /// <returns></returns> + public bool AddStatusChangeRecord(LocationChangeRecordDto changeRecordDto) + { + DtLocationStatusChangeRecord dtLocationStatusChangeRecord = new DtLocationStatusChangeRecord() + { + ChangeType = changeRecordDto.ChangeType, + LocationCode = changeRecordDto.LocationCode, + LocationId = changeRecordDto.LocationId, + Creater = "System", + TaskNum = changeRecordDto.TaskNum, + AfterStatus = changeRecordDto.AfterStatus, + BeforeStatus = changeRecordDto.BeforeStatus, + }; + return AddData(dtLocationStatusChangeRecord) > 0; + } + /// <summary> + /// 娣诲姞璐т綅鍙樺姩璁板綍 + /// </summary> + /// <param name="locationInfo">鏇存柊瀹炰綋</param> + /// <param name="lastStatus">鍙樺姩鍓嶇姸鎬�</param> + /// <param name="changeType">鍙樺姩绫诲瀷</param> + /// <param name="taskNum">浠诲姟鍙�</param> + /// <exception cref="Exception"></exception> + public void AddLocationStatusChangeRecord(DtLocationInfo locationInfo, int lastStatus, int changeType, int? taskNum) + { + try + { + DtLocationStatusChangeRecord locationStatusChangeRecord = new DtLocationStatusChangeRecord() + { + AfterStatus = locationInfo.LocationStatus, + BeforeStatus = lastStatus, + ChangeType = changeType, + LocationCode = locationInfo.LocationCode, + LocationId = locationInfo.Id, + TaskNum = taskNum, + Creater = "System", + CreateDate = DateTime.Now, + }; + + base.AddData(locationStatusChangeRecord); + } + catch (Exception ex) + { + throw new Exception($"{ex.Message}"); + } + } + + public void AddLocationStatusChangeRecord(List<DtLocationInfo> locationInfos, int newStatus, int changeType, List<int>? taskNums) + { + try + { + List<DtLocationStatusChangeRecord> records = new List<DtLocationStatusChangeRecord>(); + for (int i = 0; i < locationInfos.Count; i++) + { + DtLocationInfo locationInfo = locationInfos[i]; + int? taskNum = (taskNums != null && taskNums.Count > 0 && taskNums.Count == locationInfos.Count) ? taskNums[i] : null; + DtLocationStatusChangeRecord locationStatusChangeRecord = new DtLocationStatusChangeRecord() + { + AfterStatus = newStatus, + BeforeStatus = locationInfo.LocationStatus, + ChangeType = changeType, + LocationCode = locationInfo.LocationCode, + LocationId = locationInfo.Id, + TaskNum = taskNum, + }; + records.Add(locationStatusChangeRecord); + } + AddData(records); + } + catch (Exception ex) + { + throw new Exception($"{ex.Message}"); + } + } + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicRepository/Stock/Dt_WheelsStockRepository.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicRepository/Stock/Dt_WheelsStockRepository.cs" new file mode 100644 index 0000000..6ea73d9 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicRepository/Stock/Dt_WheelsStockRepository.cs" @@ -0,0 +1,9 @@ +锘縩amespace WIDESEA_StorageBasicRepository +{ + public class Dt_WheelsStockRepository : RepositoryBase<Dt_WheelsStock>, IDt_WheelsStockRepository + { + public Dt_WheelsStockRepository(IUnitOfWorkManage unitOfWorkManage) : base(unitOfWorkManage) + { + } + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicRepository/Stock/Dt_WheelsStock_OldRepository.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicRepository/Stock/Dt_WheelsStock_OldRepository.cs" new file mode 100644 index 0000000..5a871a9 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicRepository/Stock/Dt_WheelsStock_OldRepository.cs" @@ -0,0 +1,9 @@ +锘縩amespace WIDESEA_StorageBasicRepository +{ + public class Dt_WheelsStock_OldRepository : RepositoryBase<Dt_WheelsStock_Old>, IDt_WheelsStock_OldRepository + { + public Dt_WheelsStock_OldRepository(IUnitOfWorkManage unitOfWorkManage) : base(unitOfWorkManage) + { + } + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicRepository/Stock/Dt_WheelsStock_htyRepository.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicRepository/Stock/Dt_WheelsStock_htyRepository.cs" new file mode 100644 index 0000000..ea16174 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicRepository/Stock/Dt_WheelsStock_htyRepository.cs" @@ -0,0 +1,9 @@ +锘縩amespace WIDESEA_StorageBasicRepository +{ + public class Dt_WheelsStock_htyRepository : RepositoryBase<Dt_WheelsStock_hty>, IDt_WheelsStock_htyRepository + { + public Dt_WheelsStock_htyRepository(IUnitOfWorkManage unitOfWorkManage) : base(unitOfWorkManage) + { + } + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicRepository/Stock/StockInfoDetailRepository.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicRepository/Stock/StockInfoDetailRepository.cs" new file mode 100644 index 0000000..e501175 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicRepository/Stock/StockInfoDetailRepository.cs" @@ -0,0 +1,9 @@ +锘縩amespace WIDESEA_StorageBasicRepository +{ + public class StockInfoDetailRepository : RepositoryBase<DtStockInfoDetail>, IStockInfoDetailRepository + { + public StockInfoDetailRepository(IUnitOfWorkManage unitOfWorkManage) : base(unitOfWorkManage) + { + } + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicRepository/Stock/StockInfoRepository.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicRepository/Stock/StockInfoRepository.cs" new file mode 100644 index 0000000..59bac47 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicRepository/Stock/StockInfoRepository.cs" @@ -0,0 +1,9 @@ +锘縩amespace WIDESEA_StorageBasicRepository +{ + public class StockInfoRepository : RepositoryBase<DtStockInfo>, IStockInfoRepository + { + public StockInfoRepository(IUnitOfWorkManage unitOfWorkManage) : base(unitOfWorkManage) + { + } + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/BasicInfo/Dt_SelectionStandardsService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/BasicInfo/Dt_SelectionStandardsService.cs" new file mode 100644 index 0000000..457eae1 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/BasicInfo/Dt_SelectionStandardsService.cs" @@ -0,0 +1,66 @@ +锘縰sing WIDESEA_IServices; +using WIDESEAWCS_BasicInfoRepository; +using WIDESEAWCS_Model.Models; + +namespace WIDESEAWCS_BasicInfoService +{ + public partial class Dt_SelectionStandardsService : ServiceBase<Dt_SelectionStandards, IDt_SelectionStandardsRepository>, IDt_SelectionStandardsService + { + public Dt_SelectionStandardsService(IDt_SelectionStandardsRepository BaseDal) : base(BaseDal) + { + + } + + public override WebResponseContent AddData(SaveModel saveModel) + { + WebResponseContent content = new WebResponseContent(); + try + { + string carType = saveModel.MainData["carType"].ToString(); + string mttype = saveModel.MainData["mttype"].ToString(); + string neworold = saveModel.MainData["neworold"].ToString(); + string gkdj = saveModel.MainData["gkdj"].ToString(); + decimal lowerValue = Convert.ToDecimal(saveModel.MainData["lowerValue"]); + decimal upperValue = Convert.ToDecimal(saveModel.MainData["upperValue"]); + int isCantainGK = saveModel.MainData["isCantainGK"].ObjToInt(); + decimal lowerValue_gk = Convert.ToDecimal(saveModel.MainData["lowerValue_gk"]); + decimal upperValue_gk = Convert.ToDecimal(saveModel.MainData["upperValue_gk"]); + + if (lowerValue < 0 || upperValue < 0) throw new Exception("杩囩泩閲忓�煎紓甯�"); + + if (isCantainGK != 0) + { + if (lowerValue_gk < 0 || upperValue_gk < 0) throw new Exception("鎴潰杩囩泩閲忓�煎紓甯�"); + } + + Dt_SelectionStandards selectionStandards = new Dt_SelectionStandards + { + CarType = carType, + CreateDate = DateTime.Now, + Creater = App.User.UserName, + gkdj = gkdj, + isCantainGK = isCantainGK != 0 ? true : false, + lowerValue = lowerValue, + lowerValue_gk = lowerValue_gk, + mttype = mttype, + neworold = neworold, + upperValue_gk = upperValue_gk, + upperValue = upperValue + }; + + if (BaseDal.AddData(selectionStandards) > 0) + { + return content.OK("娣诲姞鎴愬姛"); + } + else + { + return content.Error("娣诲姞澶辫触"); + } + } + catch (Exception ex) + { + return content.Error($"娣诲姞澶辫触:{ex.Message}"); + } + } + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/BasicInfo/Dt_StationManagerService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/BasicInfo/Dt_StationManagerService.cs" new file mode 100644 index 0000000..78476c8 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/BasicInfo/Dt_StationManagerService.cs" @@ -0,0 +1,16 @@ +锘縰sing WIDESEA_IServices; +using WIDESEAWCS_BasicInfoRepository; +using WIDESEAWCS_Model.Models; + +namespace WIDESEAWCS_BasicInfoService +{ + public partial class Dt_StationManagerService : ServiceBase<Dt_StationManager, IDt_StationManagerRepository>, IDt_StationManagerService + { + private readonly ISys_ConfigService _sys_ConfigService; + + public Dt_StationManagerService(IDt_StationManagerRepository BaseDal, ISys_ConfigService sys_ConfigService) : base(BaseDal) + { + _sys_ConfigService = sys_ConfigService; + } + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/BasicInfo/Dt_TraintypeService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/BasicInfo/Dt_TraintypeService.cs" new file mode 100644 index 0000000..ec142e3 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/BasicInfo/Dt_TraintypeService.cs" @@ -0,0 +1,14 @@ +锘縰sing WIDESEA_IServices; +using WIDESEAWCS_BasicInfoRepository; +using WIDESEAWCS_Model.Models; + +namespace WIDESEAWCS_BasicInfoService +{ + public partial class Dt_TraintypeService : ServiceBase<Dt_Traintype, IDt_TraintypeRepository>, IDt_TraintypeService + { + public Dt_TraintypeService(IDt_TraintypeRepository BaseDal) : base(BaseDal) + { + + } + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/BasicInfo/Dt_needBarcodeService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/BasicInfo/Dt_needBarcodeService.cs" new file mode 100644 index 0000000..4559635 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/BasicInfo/Dt_needBarcodeService.cs" @@ -0,0 +1,14 @@ +锘縰sing WIDESEA_IServices; +using WIDESEAWCS_BasicInfoRepository; +using WIDESEAWCS_Model.Models; + +namespace WIDESEAWCS_BasicInfoService +{ + public partial class dt_needBarcodeService : ServiceBase<dt_needBarcode, IDt_needBarcodeRepository>, Idt_needBarcodeService + { + public dt_needBarcodeService(IDt_needBarcodeRepository BaseDal) : base(BaseDal) + { + + } + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/BasicInfo/Partial/Method.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/BasicInfo/Partial/Method.cs" new file mode 100644 index 0000000..6120cbf --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/BasicInfo/Partial/Method.cs" @@ -0,0 +1,24 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEAWCS_Model.Models; + +namespace WIDESEAWCS_BasicInfoService +{ + public partial class Dt_StationManagerService + { + public List<Dt_StationManager> GetAllStationByDeviceCode(string DeviceCode) + { + //todo锛� 浣跨敤缂撳瓨鍌ㄥ瓨 + return BaseDal.QueryData(x => x.stationPLC == DeviceCode).ToList(); + } + + public Dt_StationManager GetStationInfoByChildCode(string ChildCode) + { + return BaseDal.QueryFirst(x => x.stationChildCode == ChildCode); + } + + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/Boxing/BoxingInfoDetailService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/Boxing/BoxingInfoDetailService.cs" new file mode 100644 index 0000000..a0e3f0e --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/Boxing/BoxingInfoDetailService.cs" @@ -0,0 +1,8 @@ +锘縩amespace WIDESEA_StorageBasicService; + +public class BoxingInfoDetailService : ServiceBase<DtBoxingInfoDetail, IBoxingInfoDetailRepository>, IBoxingInfoDetailService +{ + public BoxingInfoDetailService(IBoxingInfoDetailRepository BaseDal) : base(BaseDal) + { + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/Boxing/BoxingInfoService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/Boxing/BoxingInfoService.cs" new file mode 100644 index 0000000..79d8610 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/Boxing/BoxingInfoService.cs" @@ -0,0 +1,51 @@ +锘縰sing Masuit.Tools; +using System.ComponentModel.DataAnnotations; + +namespace WIDESEA_StorageBasicService; + +public class BoxingInfoService : ServiceBase<DtBoxingInfo, IBoxingInfoRepository>, IBoxingInfoService +{ + public BoxingInfoService(IBoxingInfoRepository BaseDal) : base(BaseDal) + { + } + + public async Task<WebResponseContent> AddBoxingInfoAsync(DtBoxingInfo boxingInfo) + { + WebResponseContent content = new WebResponseContent(); + var info = await BaseDal.QueryFirstAsync(x => x.PalletCode == boxingInfo.PalletCode); + if (!info.IsNullOrEmpty()) + { + content.Error("璇ユ墭鐩樺凡瀛樺湪缁勭洏"); + } + else + { + // 娣诲姞缁勭洏淇℃伅 + var result = await BaseDal.AddDataNavAsync(boxingInfo); + if (result) + { + content.OK("娣诲姞鎴愬姛", boxingInfo); + } + } + return content; + } + + public override PageGridData<DtBoxingInfo> GetPageData(PageDataOptions options) + { + return base.GetPageData(options); + } + + // 楠岃瘉妯″瀷 + public static List<ValidationResult> ValidateModel(object model) + { + // 鍒涘缓涓�涓獙璇佺粨鏋滃垪琛� + var validationResults = new List<ValidationResult>(); + // 鍒涘缓涓�涓獙璇佷笂涓嬫枃 + var validationContext = new ValidationContext(model, serviceProvider: null, items: null); + + // 浣跨敤楠岃瘉鍣ㄥ皾璇曢獙璇佹ā鍨嬶紝骞跺皢楠岃瘉缁撴灉娣诲姞鍒伴獙璇佺粨鏋滃垪琛ㄤ腑 + Validator.TryValidateObject(model, validationContext, validationResults, validateAllProperties: true); + + // 杩斿洖楠岃瘉缁撴灉鍒楄〃 + return validationResults; + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/Boxing/Dt_CZInfo_mesService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/Boxing/Dt_CZInfo_mesService.cs" new file mode 100644 index 0000000..d2caa3e --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/Boxing/Dt_CZInfo_mesService.cs" @@ -0,0 +1,202 @@ +锘縰sing Mapster; +using Masuit.Tools; +using Microsoft.EntityFrameworkCore.Metadata.Internal; +using System.ComponentModel.DataAnnotations; +using WIDESEA_Core; +using WIDESEA_StorageBasicRepository; + +namespace WIDESEA_StorageBasicService; + +public class Dt_CZInfo_mesService : ServiceBase<Dt_CZInfo_mes, IDt_CZInfo_mesRepository>, IDt_CZInfo_mesService +{ + private readonly IDt_WheelsStockRepository _WheelsStockRepository; + private readonly IDt_InWheels_mes_htyRepository _InWheels_Mes_HtyRepository; + private readonly IDt_CZInfo_mes_htyRepository _CZInfo_mes_HtyRepository; + + public Dt_CZInfo_mesService(IDt_WheelsStockRepository wheelsStockRepository, IDt_InWheels_mes_htyRepository inWheels_Mes_HtyRepository, + IDt_CZInfo_mes_htyRepository cZInfo_Mes_HtyRepository, IDt_CZInfo_mesRepository BaseDal) : base(BaseDal) + { + _WheelsStockRepository = wheelsStockRepository; + _InWheels_Mes_HtyRepository = inWheels_Mes_HtyRepository; + _CZInfo_mes_HtyRepository = cZInfo_Mes_HtyRepository; + } + + public override PageGridData<Dt_CZInfo_mes> GetPageData(PageDataOptions options) + { + return base.GetPageData(options); + } + + //public override WebResponseContent AddData(SaveModel saveModel) + //{ + // WebResponseContent content = new WebResponseContent(); + // try + // { + // //濡傚綋鍓嶅瓨鍦ㄦ湭寮�濮嬪叆搴撶殑杞﹁疆鎴栧埗鍔ㄧ洏鏁版嵁,鍒欑姝繚瀛樻柊鏁版嵁 浠ラ槻鏁版嵁娣蜂贡 + // var waitInbound = BaseDal.QueryFirst(x => x.Wheels_CurrentStatue == "0"); + // if (waitInbound != null) throw new Exception("褰撳墠瀛樺湪鏈紑濮嬪叆搴撶殑杞﹁疆鎴栧埗鍔ㄧ洏,璇峰厛鍏ュ簱鍚庡啀淇濆瓨淇℃伅!"); + + + // //杞﹁疆鐮� + // string clCode = saveModel.MainData["Wheels_code"].ToString(); + // if (string.IsNullOrEmpty(clCode)) + // throw new Exception($"杞﹁疆鏉$爜涓嶈兘涓虹┖"); + + // var clinfo = BaseDal.QueryFirst(x => x.Wheels_code == clCode); + // if (clinfo != null) throw new Exception("杞﹁疆褰曞叆淇℃伅宸插瓨鍦�"); + + // //妫�娴嬪簱瀛樻槸鍚﹀凡瀛樺湪 + // var wheelsStock = _WheelsStockRepository.QueryFirst(x => x.Wheels_code == clCode); + // if (wheelsStock != null) throw new Exception("搴撳唴宸插瓨鍦�,璇锋鏌ュ簱瀛�"); + + // //搴忓垪鍙� + // //string madeUnit = saveModel.MainData["xlh"].ToString(); + // //杞﹁疆鍙� + // //string clh = saveModel.MainData["clh"].ToString(); + // //杞鏉$爜 + // //string ldtm = saveModel.MainData["ldtm"].ToString(); + // ////杞﹀瀷 + // string Cartype = saveModel.MainData["Wheels_ldxh"].ToString(); + // ////閰嶅睘灞� + // //string psj = saveModel.MainData["psj"].ToString(); + // ////杞︾粍鍙� + // //string lcch = saveModel.MainData["lcch"].ToString(); + // ////鏂版棫 + // //string newOrOld = saveModel.MainData["neworold"].ToString(); + // ////杞鍙� + // //string ldh = saveModel.MainData["ldh"].ToString(); + // ////杞鍨嬪彿 + // //string ldxh = saveModel.MainData["ldxh"].ToString(); + // ////姣傚瓟绛夌骇 + // //string gkdj = saveModel.MainData["gkdj"].ToString(); + // ////姣傚瓟a鐣岄潰鍧囧�� + // //string gkzja = saveModel.MainData["gkzja"].ToString(); + // ////姣傚瓟b鐣岄潰鍧囧�� + // //string gkzjb = saveModel.MainData["gkzjb"].ToString(); + // ////姣傚瓟c鐣岄潰鍧囧�� + // //string gkzjc = saveModel.MainData["gkzjc"].ToString(); + // ////杞緞鍊� + // //string ljz = saveModel.MainData["ljz"].ToString(); + // ////棰勪及杞緞鍊� + // //string yglj = saveModel.MainData["yglj"].ToString(); + // ////鍏ュ簱鏃堕棿 + // //string rksj = saveModel.MainData["rksj"].ToString(); + // ////灞炴�� + // //string WheelsProps = saveModel.MainData["clsx"].ToString(); + // ////鍔ㄦ嫋灞炴�� + // string mttype = saveModel.MainData["Wheels_mttype"].ToString(); + // ////姣傚瓟鍧囧�� + // string gkcc = saveModel.MainData["gkcc"].ToString(); + + // //鍒涘缓浜� + // //string user = saveModel.MainData["user"].ToString(); + + + // Dt_InWheels_mes wheels_Mes = new Dt_InWheels_mes + // { + // Wheels_code = clCode, + // Wheels_Type = "1", + // Wheels_Num = "20240829-0010 /" + clCode, + // CreateDate = DateTime.Now, + // Creater = App.User.UserName == null ? "admin" : App.User.UserName, + // WheelsProps = "WheelsProps", + // Wheels_CarNo = "lcch", + // Wheels_CarType = Cartype, + // Wheels_ldxh = "ldxh", + // Wheels_CurrentStatue = "0", + // Wheels_ldtm = "ldtm", + // Wheels_InDate = "rksj", + // Wheels_level = "gkdj", + // Wheels_NewOrOld = "newOrOld", + // Wheels_psj = "psj", + // Wheels_gkcc = "gkcc", + // Wheels_gkzja = "520.120",//gkzja + // Wheels_gkzjb = "519.321",//gkzjb + // Wheels_gkzjc = "520.014",// gkzjc + // Wheels_ldh = "ldh", + // Wheels_ljz = "ljz", + // Wheels_mttype = mttype, + // //Wheels_SequenceNum = "", + // Wheels_ygljz = "yglj", + // }; + + // if (BaseDal.AddData(wheels_Mes) > 0) + // { + // return content.OK("淇濆瓨鎴愬姛"); + // } + // else + // { + // return content.Error("淇濆瓨澶辫触"); + // } + // } + // catch (Exception ex) + // { + // return content.Error($"淇濆瓨澶辫触:{ex.Message}"); + // } + //} + + public override WebResponseContent DeleteData(object[] keys) + { + WebResponseContent content = new WebResponseContent(); + try + { + var wheels_Mes = BaseDal.QueryFirst(x => x.ID == keys[0].ObjToInt()); + + if (wheels_Mes == null) throw new Exception("鏈壘鍒颁俊鎭�,璇烽噸璇�"); + + var wheels_Mes_Hty = wheels_Mes.Adapt<Dt_CZInfo_mes_hty>(); + + //wheels_Mes_Hty.Wheels_CurrentStatue = "2"; + wheels_Mes_Hty.FinishDate = DateTime.Now; + wheels_Mes_Hty.OperateType = (int)OperateTypeEnum.浜哄伐鍒犻櫎; + + _CZInfo_mes_HtyRepository.AddData(wheels_Mes_Hty); + + return base.DeleteData(keys[0]); + } + catch (Exception ex) + { + return content.Error($"鍒犻櫎澶辫触:{ex.Message}"); + } + } + + public override WebResponseContent DeleteData(object key) + { + WebResponseContent content = new WebResponseContent(); + try + { + var wheels_Mes = BaseDal.QueryFirst(x => x.ID == key.ObjToInt()); + + if (wheels_Mes == null) throw new Exception("鏈壘鍒颁俊鎭�,璇烽噸璇�"); + + var wheels_Mes_Hty = wheels_Mes.Adapt<Dt_InWheels_mes_hty>(); + + wheels_Mes_Hty.Wheels_CurrentStatue = "2"; + wheels_Mes_Hty.FinishDate = DateTime.Now; + wheels_Mes_Hty.OperateType = (int)OperateTypeEnum.浜哄伐鍒犻櫎; + + _InWheels_Mes_HtyRepository.AddData(wheels_Mes_Hty); + + return base.DeleteData(key); + } + catch (Exception ex) + { + return content.Error($"鍒犻櫎澶辫触:{ex.Message}"); + } + } + + + // 楠岃瘉妯″瀷 + public static List<ValidationResult> ValidateModel(object model) + { + // 鍒涘缓涓�涓獙璇佺粨鏋滃垪琛� + var validationResults = new List<ValidationResult>(); + // 鍒涘缓涓�涓獙璇佷笂涓嬫枃 + var validationContext = new ValidationContext(model, serviceProvider: null, items: null); + + // 浣跨敤楠岃瘉鍣ㄥ皾璇曢獙璇佹ā鍨嬶紝骞跺皢楠岃瘉缁撴灉娣诲姞鍒伴獙璇佺粨鏋滃垪琛ㄤ腑 + Validator.TryValidateObject(model, validationContext, validationResults, validateAllProperties: true); + + // 杩斿洖楠岃瘉缁撴灉鍒楄〃 + return validationResults; + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/Boxing/Dt_CZInfo_mes_htyService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/Boxing/Dt_CZInfo_mes_htyService.cs" new file mode 100644 index 0000000..e2b25e7 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/Boxing/Dt_CZInfo_mes_htyService.cs" @@ -0,0 +1,200 @@ +锘縰sing Mapster; +using Masuit.Tools; +using Microsoft.EntityFrameworkCore.Metadata.Internal; +using System.ComponentModel.DataAnnotations; +using WIDESEA_Core; +using WIDESEA_StorageBasicRepository; + +namespace WIDESEA_StorageBasicService; + +public class Dt_CZInfo_mes_htyService : ServiceBase<Dt_CZInfo_mes_hty, IDt_CZInfo_mes_htyRepository>, IDt_CZInfo_mes_htyService +{ + private readonly IDt_WheelsStockRepository _WheelsStockRepository; + private readonly IDt_InWheels_mes_htyRepository _InWheels_Mes_HtyRepository; + + public Dt_CZInfo_mes_htyService(IDt_WheelsStockRepository wheelsStockRepository, IDt_InWheels_mes_htyRepository inWheels_Mes_HtyRepository, IDt_CZInfo_mes_htyRepository BaseDal) : base(BaseDal) + { + _WheelsStockRepository = wheelsStockRepository; + _InWheels_Mes_HtyRepository = inWheels_Mes_HtyRepository; + } + + public override PageGridData<Dt_CZInfo_mes_hty> GetPageData(PageDataOptions options) + { + return base.GetPageData(options); + } + + //public override WebResponseContent AddData(SaveModel saveModel) + //{ + // WebResponseContent content = new WebResponseContent(); + // try + // { + // //濡傚綋鍓嶅瓨鍦ㄦ湭寮�濮嬪叆搴撶殑杞﹁疆鎴栧埗鍔ㄧ洏鏁版嵁,鍒欑姝繚瀛樻柊鏁版嵁 浠ラ槻鏁版嵁娣蜂贡 + // var waitInbound = BaseDal.QueryFirst(x => x.Wheels_CurrentStatue == "0"); + // if (waitInbound != null) throw new Exception("褰撳墠瀛樺湪鏈紑濮嬪叆搴撶殑杞﹁疆鎴栧埗鍔ㄧ洏,璇峰厛鍏ュ簱鍚庡啀淇濆瓨淇℃伅!"); + + + // //杞﹁疆鐮� + // string clCode = saveModel.MainData["Wheels_code"].ToString(); + // if (string.IsNullOrEmpty(clCode)) + // throw new Exception($"杞﹁疆鏉$爜涓嶈兘涓虹┖"); + + // var clinfo = BaseDal.QueryFirst(x => x.Wheels_code == clCode); + // if (clinfo != null) throw new Exception("杞﹁疆褰曞叆淇℃伅宸插瓨鍦�"); + + // //妫�娴嬪簱瀛樻槸鍚﹀凡瀛樺湪 + // var wheelsStock = _WheelsStockRepository.QueryFirst(x => x.Wheels_code == clCode); + // if (wheelsStock != null) throw new Exception("搴撳唴宸插瓨鍦�,璇锋鏌ュ簱瀛�"); + + // //搴忓垪鍙� + // //string madeUnit = saveModel.MainData["xlh"].ToString(); + // //杞﹁疆鍙� + // //string clh = saveModel.MainData["clh"].ToString(); + // //杞鏉$爜 + // //string ldtm = saveModel.MainData["ldtm"].ToString(); + // ////杞﹀瀷 + // string Cartype = saveModel.MainData["Wheels_ldxh"].ToString(); + // ////閰嶅睘灞� + // //string psj = saveModel.MainData["psj"].ToString(); + // ////杞︾粍鍙� + // //string lcch = saveModel.MainData["lcch"].ToString(); + // ////鏂版棫 + // //string newOrOld = saveModel.MainData["neworold"].ToString(); + // ////杞鍙� + // //string ldh = saveModel.MainData["ldh"].ToString(); + // ////杞鍨嬪彿 + // //string ldxh = saveModel.MainData["ldxh"].ToString(); + // ////姣傚瓟绛夌骇 + // //string gkdj = saveModel.MainData["gkdj"].ToString(); + // ////姣傚瓟a鐣岄潰鍧囧�� + // //string gkzja = saveModel.MainData["gkzja"].ToString(); + // ////姣傚瓟b鐣岄潰鍧囧�� + // //string gkzjb = saveModel.MainData["gkzjb"].ToString(); + // ////姣傚瓟c鐣岄潰鍧囧�� + // //string gkzjc = saveModel.MainData["gkzjc"].ToString(); + // ////杞緞鍊� + // //string ljz = saveModel.MainData["ljz"].ToString(); + // ////棰勪及杞緞鍊� + // //string yglj = saveModel.MainData["yglj"].ToString(); + // ////鍏ュ簱鏃堕棿 + // //string rksj = saveModel.MainData["rksj"].ToString(); + // ////灞炴�� + // //string WheelsProps = saveModel.MainData["clsx"].ToString(); + // ////鍔ㄦ嫋灞炴�� + // string mttype = saveModel.MainData["Wheels_mttype"].ToString(); + // ////姣傚瓟鍧囧�� + // string gkcc = saveModel.MainData["gkcc"].ToString(); + + // //鍒涘缓浜� + // //string user = saveModel.MainData["user"].ToString(); + + + // Dt_InWheels_mes wheels_Mes = new Dt_InWheels_mes + // { + // Wheels_code = clCode, + // Wheels_Type = "1", + // Wheels_Num = "20240829-0010 /" + clCode, + // CreateDate = DateTime.Now, + // Creater = App.User.UserName == null ? "admin" : App.User.UserName, + // WheelsProps = "WheelsProps", + // Wheels_CarNo = "lcch", + // Wheels_CarType = Cartype, + // Wheels_ldxh = "ldxh", + // Wheels_CurrentStatue = "0", + // Wheels_ldtm = "ldtm", + // Wheels_InDate = "rksj", + // Wheels_level = "gkdj", + // Wheels_NewOrOld = "newOrOld", + // Wheels_psj = "psj", + // Wheels_gkcc = "gkcc", + // Wheels_gkzja = "520.120",//gkzja + // Wheels_gkzjb = "519.321",//gkzjb + // Wheels_gkzjc = "520.014",// gkzjc + // Wheels_ldh = "ldh", + // Wheels_ljz = "ljz", + // Wheels_mttype = mttype, + // //Wheels_SequenceNum = "", + // Wheels_ygljz = "yglj", + // }; + + // if (BaseDal.AddData(wheels_Mes) > 0) + // { + // return content.OK("淇濆瓨鎴愬姛"); + // } + // else + // { + // return content.Error("淇濆瓨澶辫触"); + // } + // } + // catch (Exception ex) + // { + // return content.Error($"淇濆瓨澶辫触:{ex.Message}"); + // } + //} + + public override WebResponseContent DeleteData(object[] keys) + { + WebResponseContent content = new WebResponseContent(); + try + { + var wheels_Mes = BaseDal.QueryFirst(x => x.ID == keys[0].ObjToInt()); + + if (wheels_Mes == null) throw new Exception("鏈壘鍒颁俊鎭�,璇烽噸璇�"); + + var wheels_Mes_Hty = wheels_Mes.Adapt<Dt_InWheels_mes_hty>(); + + //wheels_Mes_Hty.Wheels_CurrentStatue = "2"; + wheels_Mes_Hty.FinishDate = DateTime.Now; + wheels_Mes_Hty.Wheels_CurrentStatue = "4"; + wheels_Mes_Hty.OperateType = (int)OperateTypeEnum.浜哄伐鍒犻櫎; + + _InWheels_Mes_HtyRepository.AddData(wheels_Mes_Hty); + + return base.DeleteData(keys[0]); + } + catch (Exception ex) + { + return content.Error($"鍒犻櫎澶辫触:{ex.Message}"); + } + } + + public override WebResponseContent DeleteData(object key) + { + WebResponseContent content = new WebResponseContent(); + try + { + var wheels_Mes = BaseDal.QueryFirst(x => x.ID == key.ObjToInt()); + + if (wheels_Mes == null) throw new Exception("鏈壘鍒颁俊鎭�,璇烽噸璇�"); + + var wheels_Mes_Hty = wheels_Mes.Adapt<Dt_InWheels_mes_hty>(); + + wheels_Mes_Hty.Wheels_CurrentStatue = "2"; + wheels_Mes_Hty.FinishDate = DateTime.Now; + wheels_Mes_Hty.OperateType = (int)OperateTypeEnum.浜哄伐鍒犻櫎; + + _InWheels_Mes_HtyRepository.AddData(wheels_Mes_Hty); + + return base.DeleteData(key); + } + catch (Exception ex) + { + return content.Error($"鍒犻櫎澶辫触:{ex.Message}"); + } + } + + + // 楠岃瘉妯″瀷 + public static List<ValidationResult> ValidateModel(object model) + { + // 鍒涘缓涓�涓獙璇佺粨鏋滃垪琛� + var validationResults = new List<ValidationResult>(); + // 鍒涘缓涓�涓獙璇佷笂涓嬫枃 + var validationContext = new ValidationContext(model, serviceProvider: null, items: null); + + // 浣跨敤楠岃瘉鍣ㄥ皾璇曢獙璇佹ā鍨嬶紝骞跺皢楠岃瘉缁撴灉娣诲姞鍒伴獙璇佺粨鏋滃垪琛ㄤ腑 + Validator.TryValidateObject(model, validationContext, validationResults, validateAllProperties: true); + + // 杩斿洖楠岃瘉缁撴灉鍒楄〃 + return validationResults; + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/Boxing/Dt_InWheels_mesService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/Boxing/Dt_InWheels_mesService.cs" new file mode 100644 index 0000000..3c0f7bf --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/Boxing/Dt_InWheels_mesService.cs" @@ -0,0 +1,211 @@ +锘縰sing Mapster; +using Masuit.Tools; +using Microsoft.EntityFrameworkCore.Metadata.Internal; +using System.ComponentModel.DataAnnotations; +using WIDESEA_Core; +using WIDESEA_Core.HttpContextUser; +using WIDESEA_StorageBasicRepository; + +namespace WIDESEA_StorageBasicService; + +public class Dt_InWheels_mesService : ServiceBase<Dt_InWheels_mes, IDt_InWheels_mesRepository>, IDt_InWheels_mesService +{ + private readonly IDt_WheelsStockRepository _WheelsStockRepository; + private readonly IDt_InWheels_mes_htyRepository _InWheels_Mes_HtyRepository; + + public Dt_InWheels_mesService(IDt_WheelsStockRepository wheelsStockRepository, IDt_InWheels_mes_htyRepository inWheels_Mes_HtyRepository, IDt_InWheels_mesRepository BaseDal) : base(BaseDal) + { + _WheelsStockRepository = wheelsStockRepository; + _InWheels_Mes_HtyRepository = inWheels_Mes_HtyRepository; + } + + public override PageGridData<Dt_InWheels_mes> GetPageData(PageDataOptions options) + { + return base.GetPageData(options); + } + + public override WebResponseContent AddData(SaveModel saveModel) + { + WebResponseContent content = new WebResponseContent(); + try + { + //濡傚綋鍓嶅瓨鍦ㄦ湭寮�濮嬪叆搴撶殑杞﹁疆鎴栧埗鍔ㄧ洏鏁版嵁,鍒欑姝繚瀛樻柊鏁版嵁 浠ラ槻鏁版嵁娣蜂贡 + var waitInbound = BaseDal.QueryFirst(x => x.Wheels_CurrentStatue == "0"); + if (waitInbound != null) throw new Exception("褰撳墠瀛樺湪鏈紑濮嬪叆搴撶殑杞﹁疆鎴栧埗鍔ㄧ洏,璇峰厛鍏ュ簱鍚庡啀淇濆瓨淇℃伅!"); + + + //杞﹁疆鐮� + string clCode = saveModel.MainData["Wheels_code"].ToString(); + if (string.IsNullOrEmpty(clCode)) + throw new Exception($"杞﹁疆鏉$爜涓嶈兘涓虹┖"); + + var clinfo = BaseDal.QueryFirst(x => x.Wheels_code == clCode); + if (clinfo != null) throw new Exception("杞﹁疆褰曞叆淇℃伅宸插瓨鍦�"); + + //妫�娴嬪簱瀛樻槸鍚﹀凡瀛樺湪 + var wheelsStock = _WheelsStockRepository.QueryFirst(x => x.Wheels_code == clCode); + if (wheelsStock != null) throw new Exception("搴撳唴宸插瓨鍦�,璇锋鏌ュ簱瀛�"); + + //搴忓垪鍙� + //string madeUnit = saveModel.MainData["xlh"].ToString(); + //杞﹁疆鍙� + //string clh = saveModel.MainData["clh"].ToString(); + //杞鏉$爜 + //string ldtm = saveModel.MainData["ldtm"].ToString(); + ////杞﹀瀷 + string Cartype = saveModel.MainData["Wheels_ldxh"].ToString(); + ////閰嶅睘灞� + //string psj = saveModel.MainData["psj"].ToString(); + ////杞︾粍鍙� + //string lcch = saveModel.MainData["lcch"].ToString(); + ////鏂版棫 + string newOrOld = saveModel.MainData["wheels_NewOrOld"].ToString(); + ////杞鍙� + //string ldh = saveModel.MainData["ldh"].ToString(); + ////杞鍨嬪彿 + //string ldxh = saveModel.MainData["ldxh"].ToString(); + ////姣傚瓟绛夌骇 + string gkdj = saveModel.MainData["wheels_level"].ToString(); + ////姣傚瓟a鐣岄潰鍧囧�� + //string gkzja = saveModel.MainData["gkzja"].ToString(); + ////姣傚瓟b鐣岄潰鍧囧�� + //string gkzjb = saveModel.MainData["gkzjb"].ToString(); + ////姣傚瓟c鐣岄潰鍧囧�� + //string gkzjc = saveModel.MainData["gkzjc"].ToString(); + ////杞緞鍊� + //string ljz = saveModel.MainData["ljz"].ToString(); + ////棰勪及杞緞鍊� + //string yglj = saveModel.MainData["yglj"].ToString(); + ////鍏ュ簱鏃堕棿 + //string rksj = saveModel.MainData["rksj"].ToString(); + ////灞炴�� + //string WheelsProps = saveModel.MainData["clsx"].ToString(); + ////鍔ㄦ嫋灞炴�� + string mttype = saveModel.MainData["Wheels_mttype"].ToString(); + if (mttype != "M" && mttype != "T") throw new Exception("鍔ㄦ嫋灞炴�т粎鑳戒负M鎴朤"); + + //姣傚瓟鍧囧�� + string gkcc = saveModel.MainData["gkcc"].ToString(); + + //鍒涘缓浜� + //string user = saveModel.MainData["user"].ToString(); + + + Dt_InWheels_mes wheels_Mes = new Dt_InWheels_mes + { + Wheels_code = DateTime.Now.ToString("yyyyMMddHHmmss") + clCode, + Wheels_Type = "1", + Wheels_Num = DateTime.Now.ToString("yyyyMMddHHmmss") + clCode, + CreateDate = DateTime.Now, + Creater = App.User.UserName == null ? "admin" : App.User.UserName, + WheelsProps = "", + Wheels_CarNo = "", + Wheels_CarType = Cartype, + Wheels_ldxh = "", + Wheels_CurrentStatue = "0", + Wheels_ldtm = "", + Wheels_InDate = DateTime.Now.ToString(), + Wheels_level = gkdj, + Wheels_NewOrOld = newOrOld, + Wheels_psj = "psj", + Wheels_gkcc = gkcc, + Wheels_gkzja = "",//gkzja + Wheels_gkzjb = "",//gkzjb + Wheels_gkzjc = "",// gkzjc + Wheels_ldh = "", + Wheels_ljz = "", + Wheels_mttype = mttype, + //Wheels_SequenceNum = "", + Wheels_ygljz = "", + }; + + if (BaseDal.AddData(wheels_Mes) > 0) + { + return content.OK("淇濆瓨鎴愬姛"); + } + else + { + return content.Error("淇濆瓨澶辫触"); + } + } + catch (Exception ex) + { + return content.Error($"淇濆瓨澶辫触:{ex.Message}"); + } + } + + public override WebResponseContent DeleteData(object[] keys) + { + WebResponseContent content = new WebResponseContent(); + try + { + var wheels_Mes = BaseDal.QueryFirst(x => x.Wheels_ID == keys[0].ObjToInt()); + + if (wheels_Mes == null) throw new Exception("鏈壘鍒颁俊鎭�,璇烽噸璇�"); + + var wheels_Mes_Hty = wheels_Mes.Adapt<Dt_InWheels_mes_hty>(); + + //wheels_Mes_Hty.Wheels_CurrentStatue = "2"; + wheels_Mes_Hty.FinishDate = DateTime.Now; + wheels_Mes_Hty.Wheels_CurrentStatue = "4"; + wheels_Mes_Hty.OperateType = (int)OperateTypeEnum.浜哄伐鍒犻櫎; + + _InWheels_Mes_HtyRepository.AddData(wheels_Mes_Hty); + + return base.DeleteData(keys[0]); + } + catch (Exception ex) + { + return content.Error($"鍒犻櫎澶辫触:{ex.Message}"); + } + } + + public override WebResponseContent DeleteData(object key) + { + WebResponseContent content = new WebResponseContent(); + try + { + var wheels_Mes = BaseDal.QueryFirst(x => x.Wheels_ID == key.ObjToInt()); + + if (wheels_Mes == null) throw new Exception("鏈壘鍒颁俊鎭�,璇烽噸璇�"); + + var wheels_Mes_Hty = wheels_Mes.Adapt<Dt_InWheels_mes_hty>(); + + wheels_Mes_Hty.Wheels_CurrentStatue = "4"; + wheels_Mes_Hty.FinishDate = DateTime.Now; + wheels_Mes_Hty.OperateType = (int)OperateTypeEnum.浜哄伐鍒犻櫎; + wheels_Mes_Hty.Modifier = App.User.UserName; + + _InWheels_Mes_HtyRepository.AddData(wheels_Mes_Hty); + + if (BaseDal.DeleteData(wheels_Mes)) + { + return content.OK("鍒犻櫎瀹屾垚"); + } + else + { + return content.Error("鍒犻櫎澶辫触"); + } + } + catch (Exception ex) + { + return content.Error($"鍒犻櫎澶辫触:{ex.Message}"); + } + } + + + // 楠岃瘉妯″瀷 + public static List<ValidationResult> ValidateModel(object model) + { + // 鍒涘缓涓�涓獙璇佺粨鏋滃垪琛� + var validationResults = new List<ValidationResult>(); + // 鍒涘缓涓�涓獙璇佷笂涓嬫枃 + var validationContext = new ValidationContext(model, serviceProvider: null, items: null); + + // 浣跨敤楠岃瘉鍣ㄥ皾璇曢獙璇佹ā鍨嬶紝骞跺皢楠岃瘉缁撴灉娣诲姞鍒伴獙璇佺粨鏋滃垪琛ㄤ腑 + Validator.TryValidateObject(model, validationContext, validationResults, validateAllProperties: true); + + // 杩斿洖楠岃瘉缁撴灉鍒楄〃 + return validationResults; + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/Boxing/Dt_InWheels_mes_htyService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/Boxing/Dt_InWheels_mes_htyService.cs" new file mode 100644 index 0000000..512d36e --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/Boxing/Dt_InWheels_mes_htyService.cs" @@ -0,0 +1,26 @@ +锘縰sing Masuit.Tools; +using System.ComponentModel.DataAnnotations; + +namespace WIDESEA_StorageBasicService; + +public class Dt_InWheels_mes_htyService : ServiceBase<Dt_InWheels_mes_hty, IDt_InWheels_mes_htyRepository>, IDt_InWheels_mes_htyService +{ + public Dt_InWheels_mes_htyService(IDt_InWheels_mes_htyRepository BaseDal) : base(BaseDal) + { + } + + // 楠岃瘉妯″瀷 + public static List<ValidationResult> ValidateModel(object model) + { + // 鍒涘缓涓�涓獙璇佺粨鏋滃垪琛� + var validationResults = new List<ValidationResult>(); + // 鍒涘缓涓�涓獙璇佷笂涓嬫枃 + var validationContext = new ValidationContext(model, serviceProvider: null, items: null); + + // 浣跨敤楠岃瘉鍣ㄥ皾璇曢獙璇佹ā鍨嬶紝骞跺皢楠岃瘉缁撴灉娣诲姞鍒伴獙璇佺粨鏋滃垪琛ㄤ腑 + Validator.TryValidateObject(model, validationContext, validationResults, validateAllProperties: true); + + // 杩斿洖楠岃瘉缁撴灉鍒楄〃 + return validationResults; + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/CacheInfo/Dt_CacheInfoService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/CacheInfo/Dt_CacheInfoService.cs" new file mode 100644 index 0000000..770bb87 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/CacheInfo/Dt_CacheInfoService.cs" @@ -0,0 +1,82 @@ +锘縰sing Mapster; +using Masuit.Tools; +using System.CodeDom; +using System.ComponentModel.DataAnnotations; +using System.Reflection.Emit; +using WIDESEA_Common; + +namespace WIDESEA_StorageBasicService; + +public class Dt_CacheInfoService : ServiceBase<Dt_CacheInfo, IDt_CacheInfoRepository>, IDt_CacheInfoService +{ + private readonly IDt_CacheInfo_htyRepository _cacheInfo_htyRepository; + public Dt_CacheInfoService(IDt_CacheInfoRepository BaseDal, IDt_CacheInfo_htyRepository cacheInfo_htyRepository) : base(BaseDal) + { + _cacheInfo_htyRepository = cacheInfo_htyRepository; + } + + public WebResponseContent AddCacheInfoByAPP(SaveModel input) + { + WebResponseContent content = new WebResponseContent(); + try + { + string operateType = input.MainData["operateType"].ToString(); + + string cztm = input.MainData["cztm"].ToString(); + if (string.IsNullOrEmpty(cztm)) throw new Exception("杞﹁酱鏉$爜涓嶈兘涓虹┖"); + + string machine = input.MainData["machine"].ToString(); + + if (operateType.Equals("1")) + { + if (BaseDal.QueryFirst(x => x.cacheNo == machine) != null) throw new Exception($"{machine}缂撳瓨鏋跺瓨鍦ㄨ溅杞存暟鎹�,璇锋牳瀹炲悗閲嶈瘯"); + + Dt_CacheInfo cacheInfo = new Dt_CacheInfo + { + cacheNo = machine, + cacheName = machine == "1000" ? "1鍙峰帇瑁呬綅" : "2鍙峰帇瑁呬綅", + targetAddress = machine == "1000" ? "2032" : "2042", + CreateDate = DateTime.Now, + Creater = "admin", + createType = 2, //1-鑷姩鍒涘缓 2-鎵嬪姩鍒涘缓 + czh = cztm, + }; + + if (BaseDal.AddData(cacheInfo) > 0) + { + content.OK("淇濆瓨鎴愬姛"); + } + else + { + content.Error("淇濆瓨澶辫触"); + } + } + else + { + var cacheInfo = BaseDal.QueryFirst(x => x.cacheNo == machine && x.czh == cztm); + if (cacheInfo == null) throw new Exception($"鏈壘鍒皗machine}缂撳瓨鏋惰溅杞磠cztm}鏁版嵁,璇锋牳瀹炲悗閲嶈瘯"); + + Dt_CacheInfo_hty cacheInfo_hty = new Dt_CacheInfo_hty(); + + cacheInfo.Adapt(cacheInfo_hty); + cacheInfo_hty.FinishDate = DateTime.Now; + cacheInfo_hty.OperateType = 4; + + if (_cacheInfo_htyRepository.AddData(cacheInfo_hty) > 0 && BaseDal.DeleteData(cacheInfo)) + { + + content.OK("淇濆瓨鎴愬姛"); + } + else + { + content.Error("淇濆瓨澶辫触"); + } + } + } + catch (Exception ex) + { + content.Error($"娣诲姞寮傚父锛歿ex.Message}"); + } + return content; + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/CacheInfo/Dt_CacheInfo_htyService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/CacheInfo/Dt_CacheInfo_htyService.cs" new file mode 100644 index 0000000..8728828 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/CacheInfo/Dt_CacheInfo_htyService.cs" @@ -0,0 +1,16 @@ +锘縰sing Mapster; +using Masuit.Tools; +using System.CodeDom; +using System.ComponentModel.DataAnnotations; +using System.Reflection.Emit; +using WIDESEA_Common; + +namespace WIDESEA_StorageBasicService; + +public class Dt_CacheInfo_htyService : ServiceBase<Dt_CacheInfo_hty, IDt_CacheInfo_htyRepository>, IDt_CacheInfo_htyService +{ + public Dt_CacheInfo_htyService(IDt_CacheInfo_htyRepository BaseDal) : base(BaseDal) + { + + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/Check/Dt_CheckResultService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/Check/Dt_CheckResultService.cs" new file mode 100644 index 0000000..f30e269 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/Check/Dt_CheckResultService.cs" @@ -0,0 +1,63 @@ +锘縰sing AngleSharp.Dom; +using Mapster; +using Masuit.Tools; +using SqlSugar; +using System.Collections.Generic; +using System.Drawing.Printing; +using System.Linq.Expressions; +using WIDESEA.Common; +using WIDESEA_Common; +using WIDESEA_Core; + +namespace WIDESEA_StorageBasicService; + +public class Dt_CheckResultService : ServiceBase<Dt_CheckResult, IDt_CheckResultRepository>, IDt_CheckResultService +{ + public Dt_CheckResultService(IDt_CheckResultRepository BaseDal) : base(BaseDal) + { + } + + public static string ZY_CheckResultInterface = "http://172.21.1.117/barcode/Webservice/WebService_ZY/Service_EQP.asmx"; + + public WebResponseContent HandUploadData(int id) + { + WebResponseContent content = new WebResponseContent(); + try + { + Dt_CheckResult checkResult = BaseDal.QueryFirst(x => x.ID == id); + if (checkResult != null) + { + string ipaddress = ZY_CheckResultInterface + "/ReportToSCE"; + + var dic = checkResult.ToDictionary(); + dic.Remove("ID"); + dic.Remove("IsUploadMES"); + + RequestReportToSCE_ZY Info = new RequestReportToSCE_ZY { s_eqptno = "CL", s_source = JsonConvert.SerializeObject(dic) }; + + var infos = Info.ToDictionary(); + + var responStr = HttpsClient.PostXml(ipaddress, infos); + + Basic_ZY result = XMLSerializationTool.DeserializeXmlToObject<Basic_ZY>(responStr); + + if (result.FLAG != "S") throw new Exception($"涓婁紶淇℃伅澶辫触:鏅虹菠鎺ュ彛杩斿洖澶辫触:{result.ERROR}"); + + checkResult.IsUploadMES = true; + if (BaseDal.UpdateData(checkResult)) + { + content.OK(); + } + else + { + content.Error(); + } + } + return content; + } + catch (Exception ex) + { + return content.Error(ex.Message); + } + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/GlobalUsing.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/GlobalUsing.cs" new file mode 100644 index 0000000..dacc750 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/GlobalUsing.cs" @@ -0,0 +1,17 @@ +锘縢lobal using AutoMapper; +global using System.Threading.Tasks; +global using WIDESEA_Core; +global using WIDESEA_Core.Enums; +global using WIDESEA_Core.BaseRepository; +global using WIDESEA_Core.BaseServices; +global using WIDESEA_Core.Helper; +global using WIDESEA_IStorageBasicRepository; +global using WIDESEA_IStorageBasicService; +global using WIDESEA_Model.Models; +global using WIDESEA_IStorageOutOrderRepository; +global using WIDESEA_IStorageOutOrderServices; +global using WIDESEA_IStorageTaskRepository; +global using WIDESEA_IStorageTaskServices; +global using Newtonsoft.Json; +global using WIDESEA_IBusinessesRepository; +global using LogLibrary.Log; \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/Location/LocationInfoService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/Location/LocationInfoService.cs" new file mode 100644 index 0000000..d8f37f8 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/Location/LocationInfoService.cs" @@ -0,0 +1,516 @@ +锘縰sing AngleSharp.Dom; +using Mapster; +using OfficeOpenXml.ConditionalFormatting; +using System.Threading.Tasks; +using WIDESEA_Common; +using WIDESEA_Core; +using WIDESEA_DTO; +using WIDESEA_Model.Models; + +namespace WIDESEA_StorageBasicService; + +public class LocationInfoService : ServiceBase<DtLocationInfo, ILocationInfoRepository>, ILocationInfoService +{ + private readonly LogFactory LogFactory = new LogFactory(); + private readonly IUnitOfWorkManage _unitOfWorkManage; + private readonly IDt_TaskRepository _taskRepository; + private readonly IDt_TaskService _taskService; + private readonly IStockInfoRepository _stockInfoRepository; + private readonly IStockInfoDetailRepository _stockInfoDetailRepository; + private readonly IDt_WareAreaInfoRepository _wareAreaInfoRepository; + private readonly ITaskExecuteDetailRepository _taskExecuteDetailRepository; + private readonly ILocationStatusChangeRecordRepository _locationStatusChangeRecordRepository; + private readonly IDt_WheelsStockRepository _WheelsStockRepository; + private readonly IMapper _mapper; + + public LocationInfoService(ILocationInfoRepository BaseDal, + IUnitOfWorkManage unitOfWorkManage, + IDt_TaskRepository taskRepository, + IStockInfoRepository stockInfoRepository, + IDt_WareAreaInfoRepository wareAreaInfoRepository, + ITaskExecuteDetailRepository taskExecuteDetailRepository, + ILocationStatusChangeRecordRepository locationStatusChangeRecordRepository, + IStockInfoDetailRepository stockInfoDetailRepository, + IMapper mapper, + IDt_TaskService taskService, + IDt_WheelsStockRepository wheelsStockRepository) : base(BaseDal) + { + _unitOfWorkManage = unitOfWorkManage; + _taskRepository = taskRepository; + _stockInfoRepository = stockInfoRepository; + _wareAreaInfoRepository = wareAreaInfoRepository; + _taskExecuteDetailRepository = taskExecuteDetailRepository; + _locationStatusChangeRecordRepository = locationStatusChangeRecordRepository; + _stockInfoDetailRepository = stockInfoDetailRepository; + _mapper = mapper; + _taskService = taskService; + _WheelsStockRepository = wheelsStockRepository; + } + + /// <summary> + /// 妫�鏌ュ苟鐢熸垚绉诲簱浠诲姟鎴栬繑鍥炲嚭搴撲换鍔� + /// </summary> + /// <param name="locationID">浠诲姟鍙�</param> + /// <returns>浠诲姟瀵硅薄</returns> + public virtual async Task<Dt_Task> TransferCheckAsync(RequestTaskDto input) + { + try + { + int taskNum = input.taskNum; + + // 鏍规嵁浠诲姟鍙疯幏鍙栦换鍔� + var outboundTask = await _taskRepository.QueryFirstAsync(x => x.TaskNum == taskNum); + if (outboundTask == null) + return null; + LogFactory.GetLog("妫�鏌ユ槸鍚﹂渶瑕佺Щ搴�").InfoFormat(true, "鏍规嵁浠诲姟鍙疯幏鍙栦换鍔�", $"浠诲姟鍙凤細{taskNum}锛屼换鍔℃暟鎹細{outboundTask}"); + + var location = await BaseDal.QueryFirstAsync(x => x.LocationCode == outboundTask.SourceAddress); + LogFactory.GetLog("妫�鏌ユ槸鍚﹂渶瑕佺Щ搴�").InfoFormat(true, "鑾峰彇鎸囧畾搴撲綅鐨勮揣浣嶆暟鎹�", $"璐т綅鍙凤細{outboundTask.SourceAddress}锛岃揣浣嶆暟鎹細{location}"); + + // 妫�鏌ユ槸鍚﹂渶瑕佽繘琛岀Щ搴� + if (CheckForInternalTransfer(location)) + { + LogFactory.GetLog("妫�鏌ユ槸鍚﹂渶瑕佺Щ搴�").InfoFormat(true, "闇�瑕佺Щ搴�", $"璐т綅鍙凤細{outboundTask.SourceAddress}锛岃揣浣嶆暟鎹細{location}"); + // 璁$畻瀵瑰簲浣嶇疆鐨勭浉瀵瑰簱浣� 锛堝鏁拌鐨勪笅涓�琛屾垨鑰呭伓鏁拌鐨勪笂涓�琛岋級 + var newLocationID = GetRelativeLocationID(location); + LogFactory.GetLog("妫�鏌ユ槸鍚﹂渶瑕佺Щ搴�").InfoFormat(true, "闇�瑕佺Щ搴�,缁勫缓闇�瑕佺Щ搴撹揣浣嶅彿", $"鏂扮殑搴撲綅ID锛歿newLocationID}"); + + var relocationTask = await _taskRepository.QueryFirstAsync(x => x.SourceAddress == newLocationID && x.Roadway == outboundTask.Roadway && x.TaskType == (int)TaskTypeEnum.Relocation); + if (relocationTask != null) return relocationTask; + + // 鑾峰彇鏂扮殑搴撲綅鐨勪换鍔� + var internalTransferTask = await _taskRepository.QueryFirstAsync(x => x.SourceAddress == newLocationID && x.Roadway == outboundTask.Roadway && x.TaskState == (int)TaskOutStatusEnum.OutNew); + + LogFactory.GetLog("妫�鏌ユ槸鍚﹂渶瑕佺Щ搴�").InfoFormat(true, "闇�瑕佺Щ搴�,鑾峰彇鏂板簱浣嶇殑浠诲姟", $"鏂板簱浣嶄换鍔★細{internalTransferTask}"); + // 濡傛灉鏂扮殑搴撲綅娌℃湁鎵惧埌瀵瑰簲鐨勪换鍔� + if (internalTransferTask == null) + { + LogFactory.GetLog("妫�鏌ユ槸鍚﹂渶瑕佺Щ搴�").InfoFormat(true, "闇�瑕佺Щ搴�,鏈幏鍙栧埌鏂板簱浣嶄换鍔�", $""); + return await HandleNoTaskAtLocation(outboundTask.SourceAddress, newLocationID, outboundTask); + } + LogFactory.GetLog("妫�鏌ユ槸鍚﹂渶瑕佺Щ搴�").InfoFormat(true, "闇�瑕佺Щ搴�,鑾峰彇鍒版柊搴撲綅浠诲姟鐩存帴杩斿洖", $"鏂板簱浣嶄换鍔★細{internalTransferTask}"); + // 鐩存帴杩斿洖涓�娣变綅鍑哄簱浠诲姟 + return internalTransferTask; + } + + // 杩斿洖褰撳墠搴撲綅鐨勫嚭搴撲换鍔� + return outboundTask; + } + catch (Exception) + { + return null; + } + } + + public override WebResponseContent UpdateData(SaveModel saveModel) + { + int id = saveModel.MainData["id"].ObjToInt(); + int status = saveModel.MainData["locationStatus"].ObjToInt(); + var location = BaseDal.QueryFirst(x => x.Id == id); + + LocationChangeRecordDto changeRecordDto = new LocationChangeRecordDto() + { + AfterStatus = status, + BeforeStatus = location.LocationStatus, + TaskNum = 0, + LocationId = id, + LocationCode = location.LocationCode, + ChangeType = (int)StatusChangeTypeEnum.ManualOperation + }; + + _locationStatusChangeRecordRepository.AddStatusChangeRecord(changeRecordDto); + + return base.UpdateData(saveModel); + } + + #region 鍒濆鍖栧簱浣� + public async Task<WebResponseContent> initializeLocation(int locationID) + { + WebResponseContent content = new WebResponseContent(); + try + { + DtLocationInfo? location = BaseDal.QueryData(x => x.Id == locationID).FirstOrDefault(); + int LastStatus = location.LocationStatus; + if (location == null) + { + return content.Error("鏈壘鍒拌揣浣嶄俊鎭�!"); + } + DtStockInfo stock = _stockInfoRepository.QueryFirst(x => x.LocationId == location.Id); + if (stock == null) + { + location.LocationStatus = (int)LocationEnum.Lock; + BaseDal.UpdateData(location); + } + else + { + _unitOfWorkManage.BeginTran(); + DtStockInfo_Hty stockInfo_Hty = stock.Adapt<DtStockInfo_Hty>(); + stockInfo_Hty.ModifyDate = DateTime.Now; + await DeleteStockInfoAsync(stock.Id); + List<DtStockInfoDetail> detail = _stockInfoDetailRepository.QueryData(x => x.StockId == stock.Id).ToList(); + if (detail != null && detail.Count() > 0) + { + List<DtStockInfoDetail_Hty> details = detail.Adapt<List<DtStockInfoDetail_Hty>>(); + await DeleteStockInfoDetailsAsync(detail); + AddStockInfoDetailHty(details); + } + await AddStockInfoHtyAsync(stockInfo_Hty); + + + location.LocationStatus = (int)LocationEnum.Lock; + BaseDal.UpdateData(location); + + _locationStatusChangeRecordRepository.AddLocationStatusChangeRecord(location, LastStatus, (int)StatusChangeTypeEnum.ManualOperation, 0); + _unitOfWorkManage.CommitTran(); + } + return content.OK(); + } + catch (Exception ex) + { + _unitOfWorkManage.RollbackTran(); + return content.Error(ex.Message); + } + } + #endregion + + #region 鍒涘缓鍘熷璐т綅鏁版嵁 + + /// <summary> + /// 鍒涘缓鍘熷璐т綅鏁版嵁 + /// </summary> + /// <param name="x">琛�</param> + /// <param name="y">鍒�</param> + /// <param name="z">灞�</param> + /// <param name="locType">璐т綅绫诲瀷锛�1銆佸崟娣�,2銆佸弻娣憋級</param> + /// <param name="areaId">搴撳尯缂栫爜</param> + /// <returns></returns> + public WebResponseContent CreateLocation(int x, int y, int z, int locType, int areaId) + { + string[] chineseNumbers = new string[] { "闆�", "涓�", "浜�", "涓�", "鍥�", "浜�", "鍏�", "涓�", "鍏�", "涔�" }; + var locationList = new List<DtLocationInfo>(); + for (int line = 1; line <= x; line++) + { + for (int column = 1; column <= y; column++) + { + for (int layer = 1; layer <= z; layer++) + { + locationList.Add(new DtLocationInfo() + { + Row = line, + Column = column, + Layer = layer, + LocationCode = line.ToString().PadLeft(3, '0') + '-' + column.ToString().PadLeft(3, '0') + '-' + layer.ToString().PadLeft(3, '0'), + LocationName = ConvertToFormattedString(line, column, layer), + LocationType = 1, + Remark = "", + Depth = locType > 1 ? (((line - 1) % 4) + 1) == 2 || (((line - 1) % 4) + 1) == 3 ? 1 : 2 : 1, + RoadwayNo = locType > 1 ? $"SC{((line - 1) / 4) + 1}" : $"SC{((line - 1) / 2) + 1}", + LocationStatus = LocationEnum.Free.ObjToInt(), + AreaId = areaId, + Creater = "systeam", + EnalbeStatus = 2, + }); + } + } + } + var isResult = BaseDal.AddData(locationList) > 0; + if (isResult) + return new WebResponseContent().OK(); + else + return new WebResponseContent().Error(); + } + + #endregion 鍒涘缓鍘熷璐т綅鏁版嵁 + + #region 鍚敤绂佺敤璐т綅 + + public WebResponseContent LocationEnable(SaveModel saveModel) + { + WebResponseContent content = new WebResponseContent(); + try + { + List<DtLocationInfo> locations = new List<DtLocationInfo>(); + int enable = Convert.ToBoolean(saveModel.Extra) ? 1 : 2; + for (int i = 0; i < saveModel.DelKeys.Count; i++) + { + DtLocationInfo location = BaseDal.QueryData(x => x.Id == int.Parse(saveModel.DelKeys[i].ToString())).FirstOrDefault(); + location.EnalbeStatus = enable; + locations.Add(location); + } + BaseDal.UpdateData(locations); + content = WebResponseContent.Instance.OK(); + } + catch (Exception ex) + { + content = WebResponseContent.Instance.Error(ex.Message); + } + finally + { + //鏃ュ織璁板綍 + } + return content; + } + + #endregion 鍚敤绂佺敤璐т綅 + + #region 鍐呴儴鏂规硶 + + #region 绉诲簱鏂规硶 + + /// <summary> + /// 璁$畻鐩稿鐨勫簱浣岻D + /// </summary> + /// <param name="locationID">褰撳墠搴撲綅ID</param> + /// <returns>鐩稿鐨勫簱浣岻D</returns> + private string GetRelativeLocationID(DtLocationInfo locationInfo) + { + int line = locationInfo.Row; + + // 璁$畻鐩稿鐨勮揣浣嶈鍊硷紝濂囨暟琛岀殑涓嬩竴琛屾垨鑰呭伓鏁拌鐨勪笂涓�琛� + int relativeLine = line % 2 == 1 ? line + 1 : line - 1; + LogFactory.GetLog("妫�鏌ユ槸鍚﹂渶瑕佺Щ搴�").InfoFormat(true, "闇�瑕佺Щ搴擄紝璁$畻鐩稿琛�", $"鍘熷璐т綅琛岋細{line}锛岃绠楃浉瀵硅揣浣嶈锛歿relativeLine}"); + + // 鏋勫缓鏂扮殑搴撲綅ID + string[] newLocationParts = new string[] { relativeLine.ToString().PadLeft(3, '0'), locationInfo.Column.ToString().PadLeft(3, '0'), locationInfo.Layer.ToString().PadLeft(3, '0') }; + return string.Join("-", newLocationParts); + } + + /// <summary> + /// 澶勭悊娌℃湁浠诲姟鐨勫簱浣嶆儏鍐� + /// </summary> + /// <param name="originalLocationID">鍘熷搴撲綅ID</param> + /// <param name="newLocationID">鏂扮殑搴撲綅ID</param> + /// <param name="outboundTask">鍑哄簱浠诲姟</param> + /// <returns>鐢熸垚鐨勭Щ搴撲换鍔℃垨鍘熷鍑哄簱浠诲姟</returns> + private async Task<Dt_Task> HandleNoTaskAtLocation(string originalLocationID, string newLocationID, Dt_Task outboundTask) + { + // 鍒ゆ柇璇ヤ綅缃槸鍚︽湁搴撳瓨 + var stockInfo = await _WheelsStockRepository.QueryFirstAsync(x => x.Wheels_Location == newLocationID); + + LogFactory.GetLog("妫�鏌ユ槸鍚﹂渶瑕佺Щ搴�").InfoFormat(true, "闇�瑕佺Щ搴�,鏈幏鍙栧埌鏂板簱浣嶄换鍔�", $"璇ヤ綅缃槸鍚︽湁搴撳瓨锛歿stockInfo}"); + if (stockInfo == null) + { + LogFactory.GetLog("妫�鏌ユ槸鍚﹂渶瑕佺Щ搴�").InfoFormat(true, "闇�瑕佺Щ搴�,鏈幏鍙栧埌搴撳瓨鏁版嵁", $"鐩存帴杩斿洖鍘熷厛鍑哄簱浠诲姟锛歿outboundTask}"); + // 濡傛灉娌℃湁搴撳瓨锛岀洿鎺ヨ繑鍥炲綋鍓嶅嚭搴撲换鍔� + return outboundTask; + } + else + { + // 濡傛灉鏈夊簱瀛橈紝鐢熸垚绉诲簱浠诲姟 + var emptyLocation = RequestLocation("SC1"); + if (emptyLocation == null) throw new Exception("鏆傛棤绌哄簱"); + + LogFactory.GetLog("妫�鏌ユ槸鍚﹂渶瑕佺Щ搴�").InfoFormat(true, "闇�瑕佺Щ搴�,鏌ユ壘鑳界Щ搴撹揣浣�", $"璐т綅鏁版嵁锛歿emptyLocation}"); + var taskNo = await _taskRepository.GetTaskNo(); + Dt_Task newTransferTask = new Dt_Task() + { + CreateDate = DateTime.Now, + Creater = App.User.UserName == null ? "admin" : App.User.UserName, + CurrentAddress = stockInfo.Wheels_Location, + Grade = 99, + MaterialNo = stockInfo.Wheels_Type, + NextAddress = emptyLocation.LocationCode, + PalletCode = stockInfo.Wheels_Num, + Remark = "绉诲簱", + Roadway = "SC1", + SourceAddress = stockInfo.Wheels_Location, + TaskNum = taskNo, + TargetAddress = emptyLocation.LocationCode, + TaskState = (int)TaskStatus.Created, + TaskType = (int)TaskTypeEnum.Relocation, + Dispatchertime = DateTime.Now, + }; + LogFactory.GetLog("妫�鏌ユ槸鍚﹂渶瑕佺Щ搴�").InfoFormat(true, "闇�瑕佺Щ搴�,鏂板缓绉诲簱浠诲姟", $"绉诲簱浠诲姟鏁版嵁锛歿newTransferTask}"); + + //淇敼搴撲綅鐘舵�� + emptyLocation.LocationStatus = (int)LocationEnum.FreeDisable; + BaseDal.UpdateData(emptyLocation); + + return await _taskRepository.Create(newTransferTask); + } + } + + /// <summary> + /// 鏍规嵁璐т綅鏄惁闇�瑕佺Щ搴� + /// </summary> + /// <param name="locationID">璐т綅ID</param> + /// <returns>鏄惁闇�瑕佺Щ搴�</returns> + private bool CheckForInternalTransfer(DtLocationInfo location) + { + return location.Depth == 2 ? true : false; + } + + + + #region 搴撲綅鍒嗛厤 + #region 鑾峰彇璐т綅 + object objLOCK = new object(); + /// <summary> + /// 鍙屽崌搴撲綅鍒嗛厤 + /// </summary> + /// <param name="RoadWayNo"></param> + /// <param name="locationInfos"></param> + /// <returns></returns> + public DtLocationInfo RequestLocation(string RoadWayNo, List<DtLocationInfo> locationInfos = null) + { + lock (objLOCK) + { + try + { + //List<DtLocationInfo> locations = new List<DtLocationInfo>(); + if (locationInfos == null || locationInfos.Count == 0) + { + locationInfos = BaseDal.QueryData(x => x.LocationStatus == (int)LocationEnum.Free && x.RoadwayNo == "SC1" && x.EnalbeStatus == 1 && x.LocationType == 1); + } + + var location = GetEmptyLocation(locationInfos); + + if (location != null) + { + if (location.Depth == 2) + { + int row = location.Row; + int relativeLine = row % 2 == 1 ? row + 1 : row - 1; + + var insideLocation = BaseDal.QueryFirst(x => x.Row == relativeLine && x.Layer == location.Layer && x.Column == location.Column); + + if (insideLocation.LocationStatus != (int)LocationEnum.Free /*|| insideLocation.EnalbeStatus ==*/ ) + { + locationInfos.Remove(location); + if (locationInfos.Count == 0) return null; + RequestLocation(RoadWayNo, locationInfos); + } + } + } + + if (location == null) + { + return null; + } + + return location; + } + catch (Exception err) + { + Console.WriteLine(err.Message.ToString()); + return null; + } + } + } + private DtLocationInfo GetEmptyLocation(List<DtLocationInfo> dtLocationInfos) + { + var locationinfo = dtLocationInfos.Where(x => x.LocationStatus == (int)LocationEnum.Free && x.RoadwayNo == "SC1" && x.EnalbeStatus == 1 && x.LocationType == 1).OrderBy(x => x.Layer).ThenByDescending(x => x.Depth).ThenBy(x => x.Row).ThenBy(x => x.Column).FirstOrDefault(); + + return locationinfo; + } + + #endregion 鑾峰彇璐т綅 + + + #endregion 搴撲綅鍒嗛厤 + + /// <summary> + /// 鏍规嵁宸烽亾鑾峰彇浜屾繁浣嶇殑绌哄簱浣� + /// </summary> + /// <param name="roadway">宸烽亾</param> + /// <returns>璐т綅瀵硅薄</returns> + private DtLocationInfo GetTransferLocationEmpty(string roadway) + { + var locationInfo = BaseDal.QueryFirst(x => x.EnalbeStatus == (int)EnableEnum.Enable && x.LocationStatus == (int)LocationEnum.Free && x.RoadwayNo == roadway); + return locationInfo; + + /* x.Depth == 2 &&*/ + //Db.Queryable<Dt_LocationInfo>() + //.Where(x => x.Status == LocationEnum.Free.ObjToInt()) + //.Where(x => x.Depth == 2.ToString()) + //.Where(x => x.Roadway == roadway) + //.First(); + } + + #endregion 绉诲簱鏂规硶 + + #region 鍒涘缓鍒濆璐т綅鏂规硶 + + public static string ConvertToFormattedString(int line, int column, int layer) + { + // 灏嗘瘡涓儴鍒嗚浆鎹负鐩爣鏍煎紡 + string lineString = ConvertNumberToChineseString(line); + string columnString = ConvertNumberToChineseString(column); + string layerString = ConvertNumberToChineseString(layer); + + // 鏍煎紡鍖栬緭鍑� + return $"{lineString}琛寋columnString}鍒梴layerString}灞�"; + } + + public static string ConvertNumberToChineseString(int number) + { + string[] chineseNumbers = { "闆�", "涓�", "浜�", "涓�", "鍥�", "浜�", "鍏�", "涓�", "鍏�", "涔�", "鍗�" }; + + if (number <= 10) + { + return chineseNumbers[number]; + } + + // 澶勭悊澶т簬10鐨勬暟瀛� + string result = string.Empty; + if (number / 10 > 1) + { + result += chineseNumbers[number / 10] + "鍗�"; + } + else + { + result += "鍗�"; + } + + if (number % 10 > 0) + { + result += chineseNumbers[number % 10]; + } + + return result; + } + + #endregion 鍒涘缓鍒濆璐т綅鏂规硶 + + #region 搴撳瓨绉诲叆鍘嗗彶 + private async Task DeleteStockInfoAsync(int stockId) + { + var isStockUpdated = await _stockInfoRepository.DeleteDataByIdAsync(stockId); + if (!isStockUpdated) + { + throw new Exception("搴撳瓨淇℃伅鏇存柊澶辫触"); + } + } + + private async Task AddStockInfoHtyAsync(DtStockInfo_Hty dtStock) + { + var isStockAdd = await SqlSugarHelper.DbWMS.InsertNav(dtStock).IncludesAllFirstLayer().ExecuteCommandAsync(); + if (!isStockAdd) + { + throw new Exception("搴撳瓨鍘嗗彶淇℃伅娣诲姞澶辫触"); + } + } + + private async Task DeleteStockInfoDetailsAsync(IEnumerable<DtStockInfoDetail> details) + { + var ids = details.Select(x => (object)x.Id).ToArray(); + var isStockDetailUpdated = await _stockInfoDetailRepository.DeleteDataByIdsAsync(ids); + if (!isStockDetailUpdated) + { + throw new Exception("搴撳瓨璇︽儏淇℃伅鏇存柊澶辫触"); + } + } + private void AddStockInfoDetailHty(List<DtStockInfoDetail_Hty> details) + { + + var isStockAdd = SqlSugarHelper.DbWMS.Insertable(details).ExecuteCommand(); + if (isStockAdd == 0) + { + throw new Exception("搴撳瓨鏄庣粏鍘嗗彶淇℃伅娣诲姞澶辫触"); + } + } + + #endregion + + #endregion 鍐呴儴鏂规硶 +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/Location/LocationStatusChangeRecordService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/Location/LocationStatusChangeRecordService.cs" new file mode 100644 index 0000000..ac1ab1e --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/Location/LocationStatusChangeRecordService.cs" @@ -0,0 +1,8 @@ +锘縩amespace WIDESEA_StorageBasicService; + +public class LocationStatusChangeRecordService : ServiceBase<DtLocationStatusChangeRecord, ILocationStatusChangeRecordRepository>, ILocationStatusChangeRecordService +{ + public LocationStatusChangeRecordService(ILocationStatusChangeRecordRepository BaseDal) : base(BaseDal) + { + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/Stock/Dt_WheelsStockService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/Stock/Dt_WheelsStockService.cs" new file mode 100644 index 0000000..73fd5fb --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/Stock/Dt_WheelsStockService.cs" @@ -0,0 +1,123 @@ +锘縰sing AngleSharp.Dom; +using Mapster; +using Masuit.Tools; +using SqlSugar; +using System.Collections.Generic; +using System.Drawing.Printing; +using System.Linq.Expressions; +using WIDESEA_Common; +using WIDESEA_Core; +using WIDESEA_StorageBasicRepository; +using WIDESEAWCS_BasicInfoRepository; + +namespace WIDESEA_StorageBasicService; + +public class Dt_WheelsStockService : ServiceBase<Dt_WheelsStock, IDt_WheelsStockRepository>, IDt_WheelsStockService +{ + private readonly IDt_WheelsStock_htyRepository _WheelsStock_HtyRepository; + private readonly IDt_SelectionStandardsRepository _SelectionStandardsRepository; + public Dt_WheelsStockService(IDt_WheelsStockRepository BaseDal, IDt_WheelsStock_htyRepository WheelsStock_HtyRepository, IDt_SelectionStandardsRepository selectionStandardsRepository) : base(BaseDal) + { + _SelectionStandardsRepository = selectionStandardsRepository; + _WheelsStock_HtyRepository = WheelsStock_HtyRepository; + } + + /// <summary> + /// 鎵归噺鍒犻櫎 + /// </summary> + /// <param name="keys"></param> + /// <returns></returns> + public override WebResponseContent DeleteData(object[] keys) + { + try + { + List<Dt_WheelsStock_hty> stockInfos = new List<Dt_WheelsStock_hty>(); + List<DtLocationInfo> locationInfos = new List<DtLocationInfo>(); + foreach (var item in keys) + { + var stock = BaseDal.QueryFirstNavAsync(x => x.Wheels_ID == item.ObjToInt()).Result; + + var stockHty = stock.Adapt<Dt_WheelsStock_hty>(); + stockHty.FinishWheelDate = DateTime.Now; + stockHty.OperateType = (int)OperateTypeEnum.浜哄伐鍒犻櫎; + _WheelsStock_HtyRepository.AddData(stockHty); + + var location = SqlSugarHelper.DbWMS.Queryable<DtLocationInfo>().FirstAsync(x => x.LocationCode == stock.Wheels_Location).Result; + location.LocationStatus = (int)LocationEnum.Free; + locationInfos.Add(location); + } + + var locationd = SqlSugarHelper.DbWMS.Updateable(locationInfos).ExecuteCommandHasChange(); + return base.DeleteData(keys); + } + catch (Exception ex) + { + return WebResponseContent.Instance.Error(ex.Message); + } + } + + public Dt_WheelsStock GetSelectionWheelsStock(List<Dt_WheelsStock> WheelsList, Dt_SelectionStandards selectionStandards, Dt_CZInfo_mes CZInfo_Mes, string wheelsPosition, string newOrOld) + { + //杩囩泩閲忎笂闄� + decimal selectionUpperValue = selectionStandards.upperValue; + //杩囩泩閲忎笅闄� + decimal selectionLowerValue = selectionStandards.lowerValue; + + decimal mesStand = 0; + string level = string.Empty; + if ("left".Equals(wheelsPosition)) //鍖归厤宸﹁疆搴ц疆瀛� + { + mesStand = decimal.Parse(CZInfo_Mes.ZLZZJ); + level = LevelChangeHelper.LevelChangeType(CZInfo_Mes.ZLZDJ); + WheelsList = WheelsList.Where(x => mesStand - (decimal.Parse(x.Wheels_gkcc)) >= selectionLowerValue && mesStand - (decimal.Parse(x.Wheels_gkcc)) <= selectionUpperValue && x.Wheels_level == level && x.Wheels_NewOrOld == newOrOld).ToList(); + } + else //鍚﹀垯鍖归厤鍙宠疆搴ц疆瀛� + { + mesStand = decimal.Parse(CZInfo_Mes.YLZZJ); + level = LevelChangeHelper.LevelChangeType(CZInfo_Mes.YLZDJ); + WheelsList = WheelsList.Where(x => mesStand - (decimal.Parse(x.Wheels_gkcc)) >= selectionLowerValue && mesStand - (decimal.Parse(x.Wheels_gkcc)) <= selectionUpperValue && x.Wheels_level == level && x.Wheels_NewOrOld == newOrOld).ToList(); + } + + + + if (selectionStandards.isCantainGK) + { + //鎴潰杩囩泩閲忎笂闄� + decimal selectionUpperValue_gk = selectionStandards.upperValue_gk; + //鎴潰杩囩泩閲忎笅闄� + decimal selectionLowerValue_gk = selectionStandards.lowerValue_gk; + + if ("left".Equals(wheelsPosition)) + { + decimal ZLZA = decimal.Parse(CZInfo_Mes.ZLZA); + decimal ZLZB = decimal.Parse(CZInfo_Mes.ZLZB); + decimal ZLZC = decimal.Parse(CZInfo_Mes.ZLZC); + + WheelsList = WheelsList.Where(x => + ZLZA - (decimal.Parse(x.Wheels_gkzja)) >= selectionLowerValue_gk + && ZLZA - (decimal.Parse(x.Wheels_gkzja)) <= selectionUpperValue_gk + && ZLZB - (decimal.Parse(x.Wheels_gkzjb)) >= selectionLowerValue_gk + && ZLZB - (decimal.Parse(x.Wheels_gkzjb)) <= selectionUpperValue_gk + && ZLZC - (decimal.Parse(x.Wheels_gkzjc)) >= selectionLowerValue_gk + && ZLZC - (decimal.Parse(x.Wheels_gkzjc)) <= selectionUpperValue_gk + ).ToList(); + } + else + { + decimal YLZA = decimal.Parse(CZInfo_Mes.YLZA); + decimal YLZB = decimal.Parse(CZInfo_Mes.YLZB); + decimal YLZC = decimal.Parse(CZInfo_Mes.YLZC); + + WheelsList = WheelsList.Where(x => + YLZA - (decimal.Parse(x.Wheels_gkzja)) >= selectionLowerValue_gk + && YLZA - (decimal.Parse(x.Wheels_gkzja)) <= selectionUpperValue_gk + && YLZB - (decimal.Parse(x.Wheels_gkzjb)) >= selectionLowerValue_gk + && YLZB - (decimal.Parse(x.Wheels_gkzjb)) <= selectionUpperValue_gk + && YLZC - (decimal.Parse(x.Wheels_gkzjc)) >= selectionLowerValue_gk + && YLZC - (decimal.Parse(x.Wheels_gkzjc)) <= selectionUpperValue_gk + ).ToList(); + } + } + return WheelsList.OrderBy(x => x.CreateDate).FirstOrDefault(); + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/Stock/Dt_WheelsStock_OldService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/Stock/Dt_WheelsStock_OldService.cs" new file mode 100644 index 0000000..e841092 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/Stock/Dt_WheelsStock_OldService.cs" @@ -0,0 +1,66 @@ +锘縰sing AngleSharp.Dom; +using Mapster; +using Masuit.Tools; +using SqlSugar; +using System.Collections.Generic; +using System.Drawing.Printing; +using System.Linq.Expressions; +using WIDESEA_Common; +using WIDESEA_Core; +using WIDESEA_StorageBasicRepository; +using WIDESEAWCS_BasicInfoRepository; + +namespace WIDESEA_StorageBasicService; + +public class Dt_WheelsStock_OldService : ServiceBase<Dt_WheelsStock_Old, IDt_WheelsStock_OldRepository>, IDt_WheelsStock_OldService +{ + private readonly string oldLocationAddress = "http://172.21.5.167:8028/wms5/api/gzdcd/Check_St"; //鏃у簱鑾峰彇搴撳瓨鏁版嵁鍦板潃 + + public Dt_WheelsStock_OldService(IDt_WheelsStock_OldRepository BaseDal) : base(BaseDal) + { + + + } + + public WebResponseContent GetOldLocationWheels() + { + WebResponseContent content = new WebResponseContent(); + try + { + var currentList = BaseDal.QueryData(); + + string respon = HttpsClient.Post(oldLocationAddress); + + List<Dt_WheelsStock_Old> oldWheels = JsonConvert.DeserializeObject<List<Dt_WheelsStock_Old>>(respon.ToString()); + + if (oldWheels == null || oldWheels.Count == 0) throw new Exception("鑾峰彇澶辫触:鎺ュ彛鏁版嵁涓虹┖"); + + oldWheels = oldWheels.Where(x => !string.IsNullOrEmpty(x.wheel_code)).ToList(); + + var deleteList = currentList.Except(oldWheels).ToList(); + //currentList.Where(x=>x.wheel_code) + + if (BaseDal.AddData(oldWheels) > 1) + { + return content.OK("鏃у簱鏁版嵁鑾峰彇鎴愬姛"); + } + else + { + return content.Error(); + } + } + catch (Exception ex) + { + if (ex.Message.Contains("404")) + { + return content.Error("鏃у簱绋嬪簭鏈惎鍔紝鏃犳硶璁块棶鎺ュ彛"); + } + else + { + return content.Error(ex.Message); + } + + } + } + +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/Stock/Dt_WheelsStock_htyService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/Stock/Dt_WheelsStock_htyService.cs" new file mode 100644 index 0000000..5b6de8b --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/Stock/Dt_WheelsStock_htyService.cs" @@ -0,0 +1,17 @@ +锘縰sing AngleSharp.Dom; +using Mapster; +using Masuit.Tools; +using SqlSugar; +using System.Collections.Generic; +using System.Drawing.Printing; +using System.Linq.Expressions; +using WIDESEA_Core; + +namespace WIDESEA_StorageBasicService; + +public class Dt_WheelsStock_htyService : ServiceBase<Dt_WheelsStock_hty, IDt_WheelsStock_htyRepository>, IDt_WheelsStock_htyService +{ + public Dt_WheelsStock_htyService(IDt_WheelsStock_htyRepository BaseDal) : base(BaseDal) + { + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/Stock/StockInfoDetailService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/Stock/StockInfoDetailService.cs" new file mode 100644 index 0000000..869a01d --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/Stock/StockInfoDetailService.cs" @@ -0,0 +1,8 @@ +锘縩amespace WIDESEA_StorageBasicService; + +public class StockInfoDetailService : ServiceBase<DtStockInfoDetail, IStockInfoDetailRepository>, IStockInfoDetailService +{ + public StockInfoDetailService(IStockInfoDetailRepository BaseDal) : base(BaseDal) + { + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/Stock/StockInfoService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/Stock/StockInfoService.cs" new file mode 100644 index 0000000..af6f4dd --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/Stock/StockInfoService.cs" @@ -0,0 +1,114 @@ +锘縰sing AngleSharp.Dom; +using Mapster; +using Masuit.Tools; +using SqlSugar; +using System.Collections.Generic; +using System.Drawing.Printing; +using System.Linq.Expressions; +using WIDESEA_Core; + +namespace WIDESEA_StorageBasicService; + +public class StockInfoService : ServiceBase<DtStockInfo, IStockInfoRepository>, IStockInfoService +{ + public StockInfoService(IStockInfoRepository BaseDal) : base(BaseDal) + { + } + + /// <summary> + /// 鍒嗛〉 + /// </summary> + /// <param name="options"></param> + /// <returns></returns> + public override PageGridData<DtStockInfo> GetPageData(PageDataOptions options) + { + string wheres = ValidatePageOptions(options); + //鑾峰彇鎺掑簭瀛楁 + Dictionary<string, SqlSugar.OrderByType> orderbyDic = GetPageDataSort(options, TProperties); + List<OrderByModel> orderByModels = new List<OrderByModel>(); + foreach (var item in orderbyDic) + { + OrderByModel orderByModel = new() + { + FieldName = item.Key, + OrderByType = item.Value + }; + orderByModels.Add(orderByModel); + } + + + int totalCount = 0; + List<SearchParameters> searchParametersList = new List<SearchParameters>(); + if (!string.IsNullOrEmpty(options.Wheres)) + { + try + { + searchParametersList = options.Wheres.DeserializeObject<List<SearchParameters>>(); + options.Filter = searchParametersList; + } + catch { } + } + + Expression<Func<DtStockInfo, bool>> locationStatus = null; + Expression<Func<DtStockInfo, bool>> roadwayNo = null; + foreach (var item in searchParametersList) + { + if (item.Name.Contains("locationStatus")) + { + locationStatus = x => x.LocationInfo.LocationStatus == Convert.ToInt32(item.Value); + } + else if (item.Name.Contains("roadwayNo")) + { + roadwayNo = x => x.LocationInfo.RoadwayNo.Contains(item.Value); + } + } + + var data = BaseDal.Db.Queryable<DtStockInfo>().IncludesAllFirstLayer().WhereIF(!wheres.IsNullOrEmpty(), wheres).WhereIF(locationStatus != null, locationStatus).WhereIF(roadwayNo != null, roadwayNo).OrderBy(orderByModels).ToPageList(options.Page, options.Rows, ref totalCount); + new PageGridData<DtStockInfo>(totalCount, data); + return new PageGridData<DtStockInfo>(totalCount, data); + //var data = base.GetPageData(options); + //foreach (var item in data.Rows) + //{ + // if (item.IsFull) + // item.Remark = item.StockInfoDetails.Count().ToString(); + // else + // item.Remark = "0"; + //} + //return data; + } + + /// <summary> + /// 鎵归噺鍒犻櫎 + /// </summary> + /// <param name="keys"></param> + /// <returns></returns> + public override WebResponseContent DeleteData(object[] keys) + { + try + { + List<DtStockInfo_Hty> stockInfos = new List<DtStockInfo_Hty>(); + List<DtLocationInfo> locationInfos = new List<DtLocationInfo>(); + foreach (var item in keys) + { + var stock = BaseDal.QueryFirstNavAsync(x => x.Id == item.ObjToInt()).Result; + var stockHty = stock.Adapt<DtStockInfo_Hty>(); + stockInfos.Add(stockHty); + + var location = SqlSugarHelper.DbWMS.Queryable<DtLocationInfo>().FirstAsync(x => x.Id == stock.LocationId).Result; + location.LocationStatus = (int)LocationEnum.Free; + locationInfos.Add(location); + } + + var hty = BaseDal.Db.InsertNav(stockInfos) + .Include(x => x.StockInfoDetails) + .ExecuteCommand(); + + var locationd = SqlSugarHelper.DbWMS.Updateable(locationInfos).ExecuteCommandHasChange(); + return base.DeleteData(keys); + } + catch (Exception ex) + { + return WebResponseContent.Instance.Error(ex.Message); + } + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageOutOrderRepository/GlobalUsing.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageOutOrderRepository/GlobalUsing.cs" new file mode 100644 index 0000000..cdbc65c --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageOutOrderRepository/GlobalUsing.cs" @@ -0,0 +1,3 @@ +锘縢lobal using WIDESEA_Core.BaseRepository; +global using WIDESEA_IStorageOutOrderRepository; +global using WIDESEA_Model.Models; diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageOutOrderRepository/OutboundOrder/Dt_OutOrderAndStockRepository.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageOutOrderRepository/OutboundOrder/Dt_OutOrderAndStockRepository.cs" new file mode 100644 index 0000000..6bc84a1 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageOutOrderRepository/OutboundOrder/Dt_OutOrderAndStockRepository.cs" @@ -0,0 +1,53 @@ +锘縩amespace WIDESEA_StorageOutOrderRepository; + +public class Dt_OutOrderAndStockRepository : RepositoryBase<Dt_OutOrderAndStock>, IDt_OutOrderAndStockRepository +{ + public Dt_OutOrderAndStockRepository(IUnitOfWorkManage unitOfWorkManage) : base(unitOfWorkManage) + { + } + + /// <summary> + /// 鏍规嵁鐗瑰畾鏉′欢鑾峰彇鍑哄簱鐗╂枡淇℃伅 + /// </summary> + /// <param name="locationID">璐т綅ID</param> + /// <param name="orderNum">鍑哄簱璁㈠崟</param> + /// <param name="palletCode">鎵樼洏鍙�</param> + /// <returns>鍑哄簱鐗╂枡淇℃伅</returns> + public async Task<Dt_OutOrderAndStock> GetOrderAndStock(string locationID = null, string orderNum = null, string palletCode = null) + { + return await Db.Queryable<Dt_OutOrderAndStock>() + .Includes(x => x.OrderList) + //.Includes(x => x.StockList) + //.Includes(x => x.LocationList) + .WhereIF(locationID != null, x => x.LocationCode == locationID) + .WhereIF(orderNum != null, x => x.OrderNumber == orderNum) + .WhereIF(palletCode != null, x => x.PalletCode == palletCode) + .FirstAsync(); + } + + /// <summary> + /// 瀵艰埅鍒犻櫎 + /// </summary> + /// <param name="stock">鍑哄簱鐗╂枡淇℃伅</param> + /// <returns>鎴愬姛/澶辫触</returns> + public bool DeleteNavOrderStock(Dt_OutOrderAndStock stock) + { + return Db.DeleteNav<Dt_OutOrderAndStock>(x => x.Id == stock.Id) + .Include(x => x.OrderList).ThenInclude(x => x.OrderDetailList) + //.Include(x => x.StockList).ThenInclude(x => x.Dt_BillGroupStockDetailList) + .ExecuteCommand(); + } + + /// <summary> + /// 瀵艰埅鏇存柊 + /// </summary> + /// <param name="stock">鍑哄簱鐗╂枡淇℃伅</param> + /// <returns>鎴愬姛/澶辫触</returns> + public bool UpdateNavOrderStock(Dt_OutOrderAndStock stock) + { + return Db.UpdateNav(stock) + .Include(x => x.OrderList) + //.Include(x => x.StockList) + .ExecuteCommand(); + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageOutOrderRepository/OutboundOrder/Dt_OutOrderAndStock_HtyRepository.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageOutOrderRepository/OutboundOrder/Dt_OutOrderAndStock_HtyRepository.cs" new file mode 100644 index 0000000..3402871 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageOutOrderRepository/OutboundOrder/Dt_OutOrderAndStock_HtyRepository.cs" @@ -0,0 +1,21 @@ +锘縩amespace WIDESEA_StorageOutOrderRepository; + +public class Dt_OutOrderAndStock_HtyRepository : RepositoryBase<Dt_OutOrderAndStock_Hty>, IDt_OutOrderAndStock_HtyRepository +{ + public Dt_OutOrderAndStock_HtyRepository(IUnitOfWorkManage unitOfWorkManage) : base(unitOfWorkManage) + { + } + + /// <summary> + /// 瀵艰埅娣诲姞锛堟坊鍔犲簱瀛樹富浠庡巻鍙诧紝璁㈠崟涓讳粠鍘嗗彶锛� + /// </summary> + /// <param name="stock">鍑哄簱鐗╂枡淇℃伅鍘嗗彶</param> + /// <returns>鎴愬姛/澶辫触</returns> + public bool InsertNav(Dt_OutOrderAndStock_Hty stock) + { + return Db.InsertNav(stock) + .Include(x => x.OrderList).ThenInclude(x => x.orderDetailList) + //.Include(x => x.StockList).ThenInclude(x => x.StockDetailList) + .ExecuteCommand(); + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageOutOrderRepository/OutboundOrder/Dt_OutOrderDtailRepository.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageOutOrderRepository/OutboundOrder/Dt_OutOrderDtailRepository.cs" new file mode 100644 index 0000000..99d27bd --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageOutOrderRepository/OutboundOrder/Dt_OutOrderDtailRepository.cs" @@ -0,0 +1,8 @@ +锘縩amespace WIDESEA_StorageOutOrderRepository; + +public class Dt_OutOrderDtailRepository : RepositoryBase<Dt_OutOrderDetail>, IDt_OutOrderDtailRepository +{ + public Dt_OutOrderDtailRepository(IUnitOfWorkManage unitOfWorkManage) : base(unitOfWorkManage) + { + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageOutOrderRepository/OutboundOrder/Dt_OutOrderProductionDetailRepository.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageOutOrderRepository/OutboundOrder/Dt_OutOrderProductionDetailRepository.cs" new file mode 100644 index 0000000..4c6e9c8 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageOutOrderRepository/OutboundOrder/Dt_OutOrderProductionDetailRepository.cs" @@ -0,0 +1,8 @@ +锘縩amespace WIDESEA_StorageOutOrderRepository; + +public class Dt_OutOrderProductionDetailRepository : RepositoryBase<Dt_OutOrderProductionDetail>, IDt_OutOrderProductionDetailRepository +{ + public Dt_OutOrderProductionDetailRepository(IUnitOfWorkManage unitOfWorkManage) : base(unitOfWorkManage) + { + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageOutOrderRepository/OutboundOrder/Dt_OutOrderProductionRepository.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageOutOrderRepository/OutboundOrder/Dt_OutOrderProductionRepository.cs" new file mode 100644 index 0000000..981365f --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageOutOrderRepository/OutboundOrder/Dt_OutOrderProductionRepository.cs" @@ -0,0 +1,18 @@ +锘縩amespace WIDESEA_StorageOutOrderRepository; + +public class Dt_OutOrderProductionRepository : RepositoryBase<Dt_OutOrderProduction>, IDt_OutOrderProductionRepository +{ + public Dt_OutOrderProductionRepository(IUnitOfWorkManage unitOfWorkManage) : base(unitOfWorkManage) + { + } + + /// <summary> + /// 鎻掑叆鏁版嵁杩斿洖涓婚敭 + /// </summary> + /// <param name="production">瀹炰綋鏁版嵁</param> + /// <returns>涓婚敭ID</returns> + public int InsertOrderProduction(Dt_OutOrderProduction production) + { + return Db.Insertable(production).ExecuteReturnIdentity(); + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageOutOrderRepository/OutboundOrder/Dt_OutOrderRepository.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageOutOrderRepository/OutboundOrder/Dt_OutOrderRepository.cs" new file mode 100644 index 0000000..2311f5d --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageOutOrderRepository/OutboundOrder/Dt_OutOrderRepository.cs" @@ -0,0 +1,30 @@ +锘縰sing WIDESEA_Core; + +namespace WIDESEA_StorageOutOrderRepository; + +public class Dt_OutOrderRepository : RepositoryBase<Dt_OutOrder>, IDt_OutOrderRepository +{ + public Dt_OutOrderRepository(IUnitOfWorkManage unitOfWorkManage) : base(unitOfWorkManage) + { + } + + public Task<Dt_OutOrder> GetOutOrderByNumberAsync(string orderNumber) + { + Task<Dt_OutOrder>? order = Db.Queryable<Dt_OutOrder>() + .Includes(x => x.OrderDetailList) + .Where(x => x.OrderNumber == orderNumber).FirstAsync(); + return order; + } + + /// <summary> + /// 淇敼鍑哄簱璁㈠崟锛堝鑸慨鏀癸級 + /// </summary> + /// <param name="outOrder"></param> + /// <returns>鏄惁鎴愬姛</returns> + public async Task<bool> OutOrderUpdatedAsync(Dt_OutOrder outOrder) + { + return await Db.UpdateNav(outOrder) + .Include(x => x.OrderDetailList) + .ExecuteCommandAsync(); + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageOutOrderRepository/OutboundOrder/Dt_OutOrderTransferDetailRepository.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageOutOrderRepository/OutboundOrder/Dt_OutOrderTransferDetailRepository.cs" new file mode 100644 index 0000000..01c4b84 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageOutOrderRepository/OutboundOrder/Dt_OutOrderTransferDetailRepository.cs" @@ -0,0 +1,8 @@ +锘縩amespace WIDESEA_StorageOutOrderRepository; + +public class Dt_OutOrderTransferDetailRepository : RepositoryBase<Dt_OutOrderTransferDetail>, IDt_OutOrderTransferDetailRepository +{ + public Dt_OutOrderTransferDetailRepository(IUnitOfWorkManage unitOfWorkManage) : base(unitOfWorkManage) + { + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageOutOrderRepository/OutboundOrder/Dt_OutOrderTransferRepository.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageOutOrderRepository/OutboundOrder/Dt_OutOrderTransferRepository.cs" new file mode 100644 index 0000000..f41f099 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageOutOrderRepository/OutboundOrder/Dt_OutOrderTransferRepository.cs" @@ -0,0 +1,8 @@ +锘縩amespace WIDESEA_StorageOutOrderRepository; + +public class Dt_OutOrderTransferRepository : RepositoryBase<Dt_OutOrderTransfer>, IDt_OutOrderTransferRepository +{ + public Dt_OutOrderTransferRepository(IUnitOfWorkManage unitOfWorkManage) : base(unitOfWorkManage) + { + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageOutOrderServices/GlobalUsing.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageOutOrderServices/GlobalUsing.cs" new file mode 100644 index 0000000..4a2165f --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageOutOrderServices/GlobalUsing.cs" @@ -0,0 +1,14 @@ +锘縢lobal using LogLibrary.Log; +global using Newtonsoft.Json; +global using System.Threading.Tasks; +global using WIDESEA_Core; +global using WIDESEA_Core.BaseRepository; +global using WIDESEA_Core.BaseServices; +global using WIDESEA_Core.Enums; +global using WIDESEA_Core.Helper; +global using WIDESEA_IBusinessesRepository; +global using WIDESEA_IStorageBasicRepository; +global using WIDESEA_IStorageOutOrderRepository; +global using WIDESEA_IStorageOutOrderServices; +global using WIDESEA_IStorageTaskRepository; +global using WIDESEA_Model.Models; diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageOutOrderServices/OutboundOrder/Dt_OutOrderAndStockService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageOutOrderServices/OutboundOrder/Dt_OutOrderAndStockService.cs" new file mode 100644 index 0000000..8a86f76 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageOutOrderServices/OutboundOrder/Dt_OutOrderAndStockService.cs" @@ -0,0 +1,44 @@ +锘縩amespace WIDESEA_StorageOutOrderServices; + +public class Dt_OutOrderAndStockService : ServiceBase<Dt_OutOrderAndStock, IDt_OutOrderAndStockRepository>, IDt_OutOrderAndStockService +{ + private readonly IUnitOfWorkManage _unitOfWorkManage; + + public Dt_OutOrderAndStockService(IDt_OutOrderAndStockRepository BaseDal, + IUnitOfWorkManage unitOfWorkManage) : base(BaseDal) + { + _unitOfWorkManage = unitOfWorkManage; + } + + /// <summary> + /// 鏍规嵁鐗瑰畾鏉′欢鑾峰彇鍑哄簱鐗╂枡淇℃伅 + /// </summary> + /// <param name="locationID">璐т綅ID</param> + /// <param name="orderNum">鍑哄簱璁㈠崟</param> + /// <param name="palletCode">鎵樼洏鍙�</param> + /// <returns>鍑哄簱鐗╂枡淇℃伅</returns> + public async Task<Dt_OutOrderAndStock> GetOrderAndStock(string locationID = null, string orderNum = null, string palletCode = null) + { + return await BaseDal.GetOrderAndStock(locationID, orderNum, palletCode); + } + + /// <summary> + /// 瀵艰埅鍒犻櫎 + /// </summary> + /// <param name="stock">鍑哄簱鐗╂枡淇℃伅</param> + /// <returns>鎴愬姛/澶辫触</returns> + public bool DeleteNavOrderStock(Dt_OutOrderAndStock stock) + { + return BaseDal.DeleteNavOrderStock(stock); + } + + /// <summary> + /// 瀵艰埅鏇存柊 + /// </summary> + /// <param name="stock">鍑哄簱鐗╂枡淇℃伅</param> + /// <returns>鎴愬姛/澶辫触</returns> + public bool UpdateNavOrderStock(Dt_OutOrderAndStock stock) + { + return BaseDal.UpdateNavOrderStock(stock); + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageOutOrderServices/OutboundOrder/Dt_OutOrderAndStock_HtyService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageOutOrderServices/OutboundOrder/Dt_OutOrderAndStock_HtyService.cs" new file mode 100644 index 0000000..c6d6197 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageOutOrderServices/OutboundOrder/Dt_OutOrderAndStock_HtyService.cs" @@ -0,0 +1,22 @@ +锘縩amespace WIDESEA_StorageOutOrderServices; + +public class Dt_OutOrderAndStock_HtyService : ServiceBase<Dt_OutOrderAndStock_Hty, IDt_OutOrderAndStock_HtyRepository>, IDt_OutOrderAndStock_HtyService +{ + private readonly IUnitOfWorkManage _unitOfWorkManage; + + public Dt_OutOrderAndStock_HtyService(IDt_OutOrderAndStock_HtyRepository BaseDal, + IUnitOfWorkManage unitOfWorkManage) : base(BaseDal) + { + _unitOfWorkManage = unitOfWorkManage; + } + + /// <summary> + /// 瀵艰埅娣诲姞锛堟坊鍔犲簱瀛樹富浠庡巻鍙诧紝璁㈠崟涓讳粠鍘嗗彶锛� + /// </summary> + /// <param name="stock">鍑哄簱鐗╂枡淇℃伅鍘嗗彶</param> + /// <returns>鎴愬姛/澶辫触</returns> + public bool InsertNav(Dt_OutOrderAndStock_Hty stock) + { + return BaseDal.InsertNav(stock); + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageOutOrderServices/OutboundOrder/Dt_OutOrderDtailService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageOutOrderServices/OutboundOrder/Dt_OutOrderDtailService.cs" new file mode 100644 index 0000000..9de222c --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageOutOrderServices/OutboundOrder/Dt_OutOrderDtailService.cs" @@ -0,0 +1,11 @@ +锘縩amespace WIDESEA_StorageOutOrderServices; + +public class Dt_OutOrderDtailService : ServiceBase<Dt_OutOrderDetail, IDt_OutOrderDtailRepository>, IDt_OutOrderDtailService +{ + private readonly IUnitOfWorkManage _unitOfWorkManage; + + public Dt_OutOrderDtailService(IDt_OutOrderDtailRepository BaseDal, IUnitOfWorkManage unitOfWorkManage) : base(BaseDal) + { + _unitOfWorkManage = unitOfWorkManage; + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageOutOrderServices/OutboundOrder/Dt_OutOrderProductionDetailService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageOutOrderServices/OutboundOrder/Dt_OutOrderProductionDetailService.cs" new file mode 100644 index 0000000..a8dedfa --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageOutOrderServices/OutboundOrder/Dt_OutOrderProductionDetailService.cs" @@ -0,0 +1,21 @@ +锘縩amespace WIDESEA_StorageOutOrderServices; + +public class Dt_OutOrderProductionDetailService : ServiceBase<Dt_OutOrderProductionDetail, IDt_OutOrderProductionDetailRepository>, IDt_OutOrderProductionDetailService +{ + private readonly IUnitOfWorkManage _unitOfWorkManage; + + public Dt_OutOrderProductionDetailService(IDt_OutOrderProductionDetailRepository BaseDal, IUnitOfWorkManage unitOfWorkManage) : base(BaseDal) + { + _unitOfWorkManage = unitOfWorkManage; + } + + /// <summary> + /// 鎻掑叆鏁版嵁杩斿洖涓婚敭 + /// </summary> + /// <param name="productionDetail">瀹炰綋鏁版嵁</param> + /// <returns>涓婚敭ID</returns> + public int AddOrderProductionDetail(Dt_OutOrderProductionDetail productionDetail) + { + return BaseDal.AddData(productionDetail); + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageOutOrderServices/OutboundOrder/Dt_OutOrderProductionService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageOutOrderServices/OutboundOrder/Dt_OutOrderProductionService.cs" new file mode 100644 index 0000000..450ef3a --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageOutOrderServices/OutboundOrder/Dt_OutOrderProductionService.cs" @@ -0,0 +1,21 @@ +锘縩amespace WIDESEA_StorageOutOrderServices; + +public class Dt_OutOrderProductionService : ServiceBase<Dt_OutOrderProduction, IDt_OutOrderProductionRepository>, IDt_OutOrderProductionService +{ + private readonly IUnitOfWorkManage _unitOfWorkManage; + + public Dt_OutOrderProductionService(IDt_OutOrderProductionRepository BaseDal, IUnitOfWorkManage unitOfWorkManage) : base(BaseDal) + { + _unitOfWorkManage = unitOfWorkManage; + } + + /// <summary> + /// 鎻掑叆鏁版嵁杩斿洖涓婚敭 + /// </summary> + /// <param name="production">瀹炰綋鏁版嵁</param> + /// <returns>涓婚敭ID</returns> + public int AddOrderProduction(Dt_OutOrderProduction production) + { + return BaseDal.AddData(production); + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageOutOrderServices/OutboundOrder/Dt_OutOrderService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageOutOrderServices/OutboundOrder/Dt_OutOrderService.cs" new file mode 100644 index 0000000..522c0f2 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageOutOrderServices/OutboundOrder/Dt_OutOrderService.cs" @@ -0,0 +1,659 @@ +锘縩amespace WIDESEA_StorageOutOrderServices; + +public class Dt_OutOrderService : ServiceBase<Dt_OutOrder, IDt_OutOrderRepository>, IDt_OutOrderService +{ + private readonly LogFactory LogFactory = new LogFactory(); + private readonly IUnitOfWorkManage _unitOfWorkManage; + private readonly IDt_OutOrderProductionService _outOrderProductionService; + private readonly IDt_OutOrderProductionDetailService _outOrderProductionDetailService; + private readonly IDt_OutOrderDtailService _outOrderDtailService; + private readonly IDt_OutOrderTransferRepository _OutOrderTransferRepository; + private readonly IDt_OutOrderTransferDetailRepository _OutOrderTransferDetailRepository; + private readonly IDt_MaterielInfoRepository _materielInfoRepository; + private readonly IStockInfoRepository _stockInfoRepository; + private readonly IDt_OutOrderAndStockRepository _outOrderAndStockRepository; + private readonly IDt_TaskRepository _taskRepository; + + public Dt_OutOrderService(IDt_OutOrderRepository BaseDal, + IUnitOfWorkManage unitOfWorkManage, + IDt_OutOrderProductionService outOrderProductionService, + IDt_OutOrderProductionDetailService outOrderProductionDetailService, + IDt_OutOrderDtailService outOrderDtailService, + IDt_OutOrderTransferDetailRepository outOrderTransferDetailRepository, + IDt_OutOrderTransferRepository outOrderTransferRepository, + IDt_MaterielInfoRepository materielInfoRepository, + IStockInfoRepository stockInfoRepository, + IDt_OutOrderAndStockRepository outOrderAndStockRepository, + IDt_TaskRepository taskRepository) : base(BaseDal) + { + _unitOfWorkManage = unitOfWorkManage; + _outOrderProductionService = outOrderProductionService; + _outOrderProductionDetailService = outOrderProductionDetailService; + _outOrderDtailService = outOrderDtailService; + _OutOrderTransferDetailRepository = outOrderTransferDetailRepository; + _OutOrderTransferRepository = outOrderTransferRepository; + _materielInfoRepository = materielInfoRepository; + _stockInfoRepository = stockInfoRepository; + _outOrderAndStockRepository = outOrderAndStockRepository; + _taskRepository = taskRepository; + } + + /// <summary> + /// 娣诲姞鐢熶骇鍑哄簱鍗� + /// </summary> + /// <param name="model">鍑哄簱鏁版嵁</param> + /// <returns>鎴愬姛鎴栧け璐�</returns> + public WebResponseContent AddOutOrderProduction(SaveModel model) + { + WebResponseContent content = new WebResponseContent(); + try + { + LogFactory.GetLog("娣诲姞鐢熶骇鍑哄簱鍗�").InfoFormat(true, "璇锋眰", JsonConvert.SerializeObject(model)); + // 1. 鏋勫缓鐢熶骇鍑哄簱鍗曞璞� + var production = CreateProductionOrder(model.MainData); + LogFactory.GetLog("娣诲姞鐢熶骇鍑哄簱鍗�").InfoFormat(true, "鏋勫缓鐢熶骇鍑哄簱鍗曞璞�", JsonConvert.SerializeObject(production)); + + // 2. 鏋勫缓鐢熶骇鍑哄簱鍗曟槑缁嗗垪琛� + var productionDetails = CreateProductionDetails(model.DetailData); + LogFactory.GetLog("娣诲姞鐢熶骇鍑哄簱鍗�").InfoFormat(true, "鏋勫缓鐢熶骇鍑哄簱鍗曟槑缁嗗璞�", JsonConvert.SerializeObject(productionDetails)); + + // 3. 鏋勫缓绯荤粺鍑哄簱鍗曞璞� + var order = CreateSystemOrder(production); + LogFactory.GetLog("娣诲姞鐢熶骇鍑哄簱鍗�").InfoFormat(true, "鏋勫缓绯荤粺鍑哄簱鍗曞璞�", JsonConvert.SerializeObject(order)); + + // 4. 鏋勫缓绯荤粺鍑哄簱鍗曟槑缁嗗垪琛� + var orderDetails = CreateSystemOrderDetails(productionDetails); + LogFactory.GetLog("娣诲姞鐢熶骇鍑哄簱鍗�").InfoFormat(true, "鏋勫缓绯荤粺鍑哄簱鍗曟槑缁嗗璞�", JsonConvert.SerializeObject(orderDetails)); + + // 寮�鍚簨鍔� + _unitOfWorkManage.BeginTran(); + + // 5. 娣诲姞鐢熶骇鍑哄簱鍗曞苟鑾峰彇涓婚敭ID + var productionId = _outOrderProductionService.AddOrderProduction(production); + LogFactory.GetLog("娣诲姞鐢熶骇鍑哄簱鍗�").InfoFormat(true, "娣诲姞鐢熶骇鍑哄簱鍗曞苟鑾峰彇涓婚敭ID", productionId); + + // 6. 鐢熶骇鍑哄簱鍗曟槑缁嗙粦瀹氫富琛↖D + productionDetails.ForEach(item => { item.ProductionOutOrderId = productionId; }); + LogFactory.GetLog("娣诲姞鐢熶骇鍑哄簱鍗�").InfoFormat(true, "鐢熶骇鍑哄簱鍗曟槑缁嗙粦瀹氫富琛↖D", productionId); + + // 7. 娣诲姞鐢熶骇鍑哄簱鍗曟槑缁� + var detailAddResult = _outOrderProductionDetailService.AddData(productionDetails); + LogFactory.GetLog("娣诲姞鐢熶骇鍑哄簱鍗�").InfoFormat(true, "娣诲姞鐢熶骇鍑哄簱鍗曟槑缁�", detailAddResult.Status); + + // 8. 绯荤粺鍑哄簱鍗曠粦瀹氱敓浜у嚭搴撳崟ID + order.UpperOutOrderId = productionId; + LogFactory.GetLog("娣诲姞鐢熶骇鍑哄簱鍗�").InfoFormat(true, "绯荤粺鍑哄簱鍗曠粦瀹氱敓浜у嚭搴撳崟ID", productionId); + + // 9. 娣诲姞绯荤粺鍑哄簱鍗曞苟鑾峰彇涓婚敭ID + var orderId = BaseDal.AddData(order); + LogFactory.GetLog("娣诲姞鐢熶骇鍑哄簱鍗�").InfoFormat(true, "娣诲姞绯荤粺鍑哄簱鍗曞苟鑾峰彇涓婚敭ID", orderId); + + // 10 . 绯荤粺鍑哄簱鍗曟槑缁嗙粦瀹氫富琛↖D + orderDetails.ForEach(item => { item.OutOrderId = orderId; }); + LogFactory.GetLog("娣诲姞鐢熶骇鍑哄簱鍗�").InfoFormat(true, "绯荤粺鍑哄簱鍗曟槑缁嗙粦瀹氫富琛↖D", orderId); + + // 11. 娣诲姞绯荤粺鍑哄簱鍗曟槑缁嗗苟杩斿洖缁撴灉 + content = _outOrderDtailService.AddData(orderDetails); + LogFactory.GetLog("娣诲姞鐢熶骇鍑哄簱鍗�").InfoFormat(true, "娣诲姞绯荤粺鍑哄簱鍗曟槑缁嗗苟杩斿洖缁撴灉", content.Status); + + if (content.Status && productionId > 0 && detailAddResult.Status && orderId > 0) + { + LogFactory.GetLog("娣诲姞鐢熶骇鍑哄簱鍗�").InfoFormat(true, "鎵�鏈夋搷浣滄墽琛屽畬鎴愭彁浜や簨鍔�", "鏃犲弬鏁�"); + _unitOfWorkManage.CommitTran(); // 鎻愪氦浜嬪姟 + } + else + { + LogFactory.GetLog("娣诲姞鐢熶骇鍑哄簱鍗�").InfoFormat(true, "娣诲姞鏁版嵁搴撳け璐�,璇锋鏌ユ暟鎹槸鍚︽纭�", $"绯荤粺鍑哄簱鍗曟槑缁�:{content.Status},娣诲姞绯荤粺鍑哄簱鍗�:{orderId > 0},鐢熶骇鍑哄簱鍗�:{productionId > 0},鐢熶骇鍑哄簱鍗曟槑缁�:{detailAddResult.Status}"); + throw new Exception("鍑哄簱鍗曟坊鍔犲け璐�" + $"绯荤粺鍑哄簱鍗曟槑缁�:{content.Status},娣诲姞绯荤粺鍑哄簱鍗�:{orderId > 0},鐢熶骇鍑哄簱鍗�:{productionId > 0},鐢熶骇鍑哄簱鍗曟槑缁�:{detailAddResult.Status}"); + } + + return content; + } + catch (Exception ex) + { + _unitOfWorkManage.RollbackTran(); // 鍥炴粴浜嬪姟 + LogFactory.GetLog("娣诲姞鐢熶骇鍑哄簱鍗�").InfoFormat(true, $"绯荤粺寮傚父锛屽紓甯镐俊鎭細{ex.Message}", "鏃犲弬鏁�"); + return content.Error(ex.Message); + } + finally + { + LogFactory.GetLog("娣诲姞鐢熶骇鍑哄簱鍗�").InfoFormat(true, "鍝嶅簲", JsonConvert.SerializeObject(content)); + } + } + + /// <summary> + /// 娣诲姞璋冩嫧鍑哄簱鍗� + /// </summary> + /// <param name="model">鍑哄簱鏁版嵁</param> + /// <returns>鎴愬姛鎴栧け璐�</returns> + public WebResponseContent AddOutOrderTransfer(SaveModel model) + { + WebResponseContent content = new WebResponseContent(); + try + { + // 1. 鏋勫缓璋冩嫧鍑哄簱鍗曞璞� + var transfer = CreateTransferOrder(model.MainData); + LogFactory.GetLog("娣诲姞璋冩嫧鍑哄簱鍗�").InfoFormat(true, "鏋勫缓璋冩嫧鍑哄簱鍗曞璞�", JsonConvert.SerializeObject(transfer)); + + // 2. 鏋勫缓璋冩嫧鍑哄簱鍗曟槑缁嗗垪琛� + var transferDetail = CreateTransferDetails(model.DetailData); + LogFactory.GetLog("娣诲姞璋冩嫧鍑哄簱鍗�").InfoFormat(true, "鏋勫缓璋冩嫧鍑哄簱鍗曟槑缁嗗璞�", JsonConvert.SerializeObject(transferDetail)); + + // 3. 鏋勫缓绯荤粺鍑哄簱鍗曞璞� + var order = CreateSystemOrder(transfer); + LogFactory.GetLog("娣诲姞璋冩嫧鍑哄簱鍗�").InfoFormat(true, "鏋勫缓绯荤粺鍑哄簱鍗曞璞�", JsonConvert.SerializeObject(order)); + + // 4. 鏋勫缓绯荤粺鍑哄簱鍗曟槑缁嗗垪琛� + var orderDetails = CreateSystemOrderDetails(transferDetail); + LogFactory.GetLog("娣诲姞璋冩嫧鍑哄簱鍗�").InfoFormat(true, "鏋勫缓绯荤粺鍑哄簱鍗曟槑缁嗗璞�", JsonConvert.SerializeObject(orderDetails)); + + // 娣诲姞浜嬪姟 + _unitOfWorkManage.BeginTran(); + + // 5. 娣诲姞璋冩嫧鍑哄簱鍗曞苟鑾峰彇涓婚敭ID + var transferId = _OutOrderTransferRepository.AddData(transfer); + LogFactory.GetLog("娣诲姞璋冩嫧鍑哄簱鍗�").InfoFormat(true, "娣诲姞璋冩嫧鍑哄簱鍗曞苟鑾峰彇涓婚敭ID", transferId); + + // 6. 璋冩嫧鍑哄簱鍗曟槑缁嗙粦瀹氫富琛↖D + transferDetail.ForEach(item => { item.TransferOutOrderId = transferId; }); + LogFactory.GetLog("娣诲姞璋冩嫧鍑哄簱鍗�").InfoFormat(true, "璋冩嫧鍑哄簱鍗曟槑缁嗙粦瀹氫富琛↖D", transferId); + + // 7. 娣诲姞鐢熶骇鍑哄簱鍗曟槑缁� + var detailAddResult = _OutOrderTransferDetailRepository.AddData(transferDetail); + LogFactory.GetLog("娣诲姞璋冩嫧鍑哄簱鍗�").InfoFormat(true, "娣诲姞鐢熶骇鍑哄簱鍗曟槑缁�", detailAddResult); + + // 8. 绯荤粺鍑哄簱鍗曠粦瀹氳皟鎷ㄥ嚭搴撳崟ID + order.UpperOutOrderId = transferId; + LogFactory.GetLog("娣诲姞璋冩嫧鍑哄簱鍗�").InfoFormat(true, "绯荤粺鍑哄簱鍗曠粦瀹氳皟鎷ㄥ嚭搴撳崟ID", transferId); + + // 9. 娣诲姞绯荤粺鍑哄簱鍗曞苟鑾峰彇涓婚敭ID + var orderId = BaseDal.AddData(order); + LogFactory.GetLog("娣诲姞璋冩嫧鍑哄簱鍗�").InfoFormat(true, "娣诲姞绯荤粺鍑哄簱鍗曞苟鑾峰彇涓婚敭ID", orderId); + + // 10 . 绯荤粺鍑哄簱鍗曟槑缁嗙粦瀹氫富琛↖D + orderDetails.ForEach(item => { item.OutOrderId = orderId; }); + LogFactory.GetLog("娣诲姞璋冩嫧鍑哄簱鍗�").InfoFormat(true, "绯荤粺鍑哄簱鍗曟槑缁嗙粦瀹氫富琛↖D", orderId); + + // 11. 娣诲姞绯荤粺鍑哄簱鍗曟槑缁嗗苟杩斿洖缁撴灉 + content = _outOrderDtailService.AddData(orderDetails); + LogFactory.GetLog("娣诲姞璋冩嫧鍑哄簱鍗�").InfoFormat(true, "娣诲姞绯荤粺鍑哄簱鍗曟槑缁嗗苟杩斿洖缁撴灉", content.Status); + + if (content.Status && transferId > 0 && detailAddResult > 0 && orderId > 0) + { + LogFactory.GetLog("娣诲姞璋冩嫧鍑哄簱鍗�").InfoFormat(true, "鎵�鏈夋搷浣滄墽琛屽畬鎴愭彁浜や簨鍔�", "鏃犲弬鏁�"); + _unitOfWorkManage.CommitTran(); // 鎻愪氦浜嬪姟 + } + else + { + LogFactory.GetLog("娣诲姞璋冩嫧鍑哄簱鍗�").InfoFormat(true, "娣诲姞鏁版嵁搴撳け璐�,璇锋鏌ユ暟鎹槸鍚︽纭�", $"绯荤粺鍑哄簱鍗曟槑缁�:{content.Status},娣诲姞绯荤粺鍑哄簱鍗�:{orderId > 0},鐢熶骇鍑哄簱鍗�:{transferId > 0},鐢熶骇鍑哄簱鍗曟槑缁�:{detailAddResult > 0}"); + throw new Exception("娣诲姞璋冩嫧鍑哄簱鍗�"); + } + return content; + } + catch (Exception ex) + { + _unitOfWorkManage.RollbackTran(); // 鍥炴粴浜嬪姟 + LogFactory.GetLog("娣诲姞璋冩嫧鍑哄簱鍗�").InfoFormat(true, $"绯荤粺寮傚父锛屽紓甯镐俊鎭細{ex.Message}", "鏃犲弬鏁�"); + return content.Error(ex.Message); + } + } + + /// <summary> + /// 鏍规嵁鍑哄簱鍗曞彿鏌ヨ鍑哄簱璁㈠崟 + /// </summary> + /// <param name="orderNumber">鍑哄簱鍗曞彿</param> + /// <returns>鍑哄簱璁㈠崟</returns> + public WebResponseContent GetOutOrderByNumber(string orderNumber) + { + WebResponseContent content = new WebResponseContent(); + var order = Db.Queryable<Dt_OutOrder>() + .Includes(x => x.OrderDetailList) + .Where(x => x.OrderNumber == orderNumber).First(); + if (order == null) + content.Error($"璁㈠崟缂栧彿{orderNumber}鏌ヨ涓虹┖"); + else + content.OK("鏌ヨ鎴愬姛", order); + return content; + } + + /// <summary> + /// 鏍规嵁璁㈠崟鍒嗛厤鍑哄簱搴撳瓨 + /// </summary> + /// <param name="orderNo">璁㈠崟缂栧彿</param> + /// <returns></returns> + public async Task<WebResponseContent> GetOutboundStockAsync(string orderNo) + { + WebResponseContent content = new WebResponseContent(); + try + { + // 鑾峰彇璁㈠崟 + var order = await BaseDal.GetOutOrderByNumberAsync(orderNo); + LogFactory.GetLog("鍑哄簱鍒嗛厤骞跺垱寤轰换鍔�").InfoFormat(true, "鏍规嵁璁㈠崟缂栧彿鑾峰彇璁㈠崟鏁版嵁", JsonConvert.SerializeObject(order)); + + // 妫�鏌ヨ鍗曟槸鍚﹁幏鍙栨垚鍔� + if (order == null) + { + return content.Error("鑾峰彇璁㈠崟澶辫触"); + } + + // 鑾峰彇璁㈠崟涓殑绗竴涓墿鏂欑紪鍙� + var materielInfo = await _materielInfoRepository.QueryFirstAsync(x => x.MaterielID == order.OrderDetailList.MaterialId); + LogFactory.GetLog("鍑哄簱鍒嗛厤骞跺垱寤轰换鍔�").InfoFormat(true, "鑾峰彇璁㈠崟鐗╂枡缂栧彿", JsonConvert.SerializeObject(materielInfo)); + + #region 鍏堝叆鍏堝嚭 + + // 鑾峰彇璇ョ墿鏂欐墍鏈夊彲鍑哄簱搴撳瓨 + var filteredStocks = await _stockInfoRepository.QueryDataAsync(x => true); + filteredStocks.OrderBy(x => x.CreateDate).ToList(); + LogFactory.GetLog("鍑哄簱鍒嗛厤骞跺垱寤轰换鍔�").InfoFormat(true, "鑾峰彇璇ョ墿鏂欐墍鏈夊彲鍑哄簱搴撳瓨", JsonConvert.SerializeObject(filteredStocks)); + + #endregion 鍏堝叆鍏堝嚭 + + #region 鏌ユ壘闈犺繎鍑哄簱鍙e簱瀛� + + // 榛樿鍒楄秺澶ц秺闈犺繎鍑哄簱鍙� + filteredStocks = filteredStocks.OrderByDescending(x => x.LocationInfo.Column).OrderBy(x => x.CreateDate).ToList(); + + #endregion 鏌ユ壘闈犺繎鍑哄簱鍙e簱瀛� + + #region 涓�娣变綅浼樺厛鏌ユ壘锛屽啀鏌ユ壘鍚屽垪浜屾繁浣� + + filteredStocks = PickStocks(filteredStocks); + + #endregion 涓�娣变綅浼樺厛鏌ユ壘锛屽啀鏌ユ壘鍚屽垪浜屾繁浣� + + // 鍒涘缓浠诲姟鍒楄〃 + var (tasks, updateOrder, stock) = CreateTasks(order, filteredStocks); + LogFactory.GetLog("鍑哄簱鍒嗛厤骞跺垱寤轰换鍔�").InfoFormat(true, "鍒涘缓浠诲姟鍒楄〃锛屼慨鏀硅鍗曞垎閰嶆暟閲忥紝鑾峰彇鍑哄簱鍒嗛厤搴撳瓨", + $"浠诲姟鍒楄〃:{JsonConvert.SerializeObject(tasks)},璁㈠崟鍒楄〃锛歿JsonConvert.SerializeObject(updateOrder)},宸插垎閰嶅簱瀛橈細{JsonConvert.SerializeObject(stock)}"); + + // 鏇存柊搴撳瓨鐘舵�� + var stockList = UpdateStocks(stock); + LogFactory.GetLog("鍑哄簱鍒嗛厤骞跺垱寤轰换鍔�").InfoFormat(true, "鏇存柊搴撳瓨鐘舵��", JsonConvert.SerializeObject(stockList)); + + // 鍒涘缓璁㈠崟搴撳瓨鍒楄〃 + List<Dt_OutOrderAndStock>? orderStocks = CreateOrderStock(stock, updateOrder); + LogFactory.GetLog("鍑哄簱鍒嗛厤骞跺垱寤轰换鍔�").InfoFormat(true, "鍒涘缓璁㈠崟搴撳瓨鍒楄〃", JsonConvert.SerializeObject(orderStocks)); + + // 寮�濮嬩簨鍔� + _unitOfWorkManage.BeginTran(); + + // 鏇存柊搴撳瓨 + var isStockUpdated = _stockInfoRepository.UpdateData(stockList); + LogFactory.GetLog("鍑哄簱鍒嗛厤骞跺垱寤轰换鍔�").InfoFormat(true, "浜嬪姟鏇存柊搴撳瓨", isStockUpdated); + + // 鏇存柊璁㈠崟 + var isOrderUpdated = await BaseDal.OutOrderUpdatedAsync(updateOrder); + LogFactory.GetLog("鍑哄簱鍒嗛厤骞跺垱寤轰换鍔�").InfoFormat(true, "浜嬪姟鏇存柊璁㈠崟", isOrderUpdated); + + //娣诲姞璁㈠崟搴撳瓨 + var isOrderStockCread = await _outOrderAndStockRepository.AddDataAsync(orderStocks) > 0; + LogFactory.GetLog("鍑哄簱鍒嗛厤骞跺垱寤轰换鍔�").InfoFormat(true, "浜嬪姟娣诲姞璁㈠崟搴撳瓨", isOrderStockCread); + + // 鍒涘缓浠诲姟 + var isTaskCreated = await _taskRepository.Create(tasks); + LogFactory.GetLog("鍑哄簱鍒嗛厤骞跺垱寤轰换鍔�").InfoFormat(true, "浜嬪姟鍒涘缓浠诲姟", isTaskCreated); + + // 鎻愪氦鎴栧洖婊氫簨鍔� + if (isStockUpdated && isTaskCreated && isOrderUpdated && isOrderStockCread) + { + LogFactory.GetLog("鍑哄簱鍒嗛厤骞跺垱寤轰换鍔�").InfoFormat(true, "鏁版嵁澶勭悊瀹屾垚锛屾彁浜や簨鍔�", "鏃犲弬鏁�"); + _unitOfWorkManage.CommitTran(); + } + else + { + LogFactory.GetLog("鍑哄簱鍒嗛厤骞跺垱寤轰换鍔�").InfoFormat(true, "娣诲姞鏁版嵁搴撳け璐�,璇锋鏌ユ暟鎹槸鍚︽纭�,鏁版嵁鍥炴粴", $"鏇存柊搴撳瓨:{isStockUpdated},鏇存柊璁㈠崟:{isOrderUpdated},娣诲姞璁㈠崟搴撳瓨:{isOrderStockCread},鍒涘缓浠诲姟:{isTaskCreated}"); + _unitOfWorkManage.RollbackTran(); + throw new Exception("娣诲姞鏁版嵁搴撳け璐�,璇锋鏌ユ暟鎹槸鍚︽纭�,鏁版嵁鍥炴粴"); + } + + return content.OK(data: orderStocks); + } + catch (Exception ex) + { + _unitOfWorkManage.RollbackTran(); + LogFactory.GetLog("鍑哄簱鍒嗛厤骞跺垱寤轰换鍔�").InfoFormat(true, $"绯荤粺寮傚父锛屽紓甯镐俊鎭細{ex.Message}", "鏃犲弬鏁�"); + return content.Error(ex.Message); + } + } + + /// <summary> + /// 淇敼鍑哄簱璁㈠崟锛堝鑸慨鏀癸級 + /// </summary> + /// <param name="outOrder"></param> + /// <returns>鏄惁鎴愬姛</returns> + public async Task<bool> OutOrderUpdatedAsync(Dt_OutOrder outOrder) + { + return await BaseDal.OutOrderUpdatedAsync(outOrder); + } + + #region 鍐呴儴璋冪敤 + + /// <summary> + /// 涓�娣变綅浼樺厛鏌ユ壘 + /// </summary> + /// <param name="filteredStocks">鍙嚭搴撳簱瀛�</param> + /// <returns>鎺掑簭濂界殑鍑哄簱搴撳瓨</returns> + public List<DtStockInfo> PickStocks(List<DtStockInfo> filteredStocks) + { + var oneDepthList = filteredStocks.Where(x => x.LocationInfo.Depth == 1).ToList(); + var twoDepthList = filteredStocks.Where(x => x.LocationInfo.Depth == 2).ToList(); + + var results = new List<DtStockInfo>(); + foreach (var oneDepth in oneDepthList) + { + // 灏� Line 瀛楃涓茶浆鎹负鏁存暟 + int oneDepthLine = oneDepth.LocationInfo.Row; + + // 璁$畻鐩稿琛� + int relativeLine = oneDepthLine % 2 == 1 ? oneDepthLine + 1 : oneDepthLine - 1; + + // 鏌ユ壘鏈�鎺ヨ繎鐨勪簩娣变綅璁板綍 + var closestTwoDepth = twoDepthList + .Where(t => t.LocationInfo.Row == relativeLine) + .Where(x => x.LocationInfo.Column == oneDepth.LocationInfo.Column) + .Where(x => x.LocationInfo.Layer == oneDepth.LocationInfo.Layer) + .FirstOrDefault(); + + // 濡傛灉鎵惧埌浜嗘渶鎺ヨ繎鐨勪簩娣变綅璁板綍锛屽皢鍏朵笌涓�娣变綅涓�璧锋坊鍔犲埌缁撴灉鍒楄〃 + if (closestTwoDepth != null) + { + results.Add(oneDepth); + results.Add(closestTwoDepth); + } + else + { + // 濡傛灉娌℃湁鎵惧埌鏈�鎺ヨ繎鐨勪簩娣变綅璁板綍锛屽皢涓�娣变綅娣诲姞鍒扮粨鏋滃垪琛� + results.Add(oneDepth); + } + } + return results; + } + + #endregion 鍐呴儴璋冪敤 + + #region 绉佹湁鏂规硶 + + #region 鐢熶骇鍑哄簱鍗� + + /// <summary> + /// 鏍规嵁涓绘暟鎹瀯寤虹敓浜у嚭搴撳崟瀵硅薄銆� + /// </summary> + private Dt_OutOrderProduction CreateProductionOrder(Dictionary<string, object> mainData) + { + return new Dt_OutOrderProduction + { + OrderNumber = mainData.GetValueOrDefault("OrderNumber")?.ToString(), + WarehouseId = mainData.GetValueOrDefault("WarehouseId")?.ObjToInt() ?? 0, + Status = (int)OutOrderTypeEnum.Issue, + Remarks = mainData.GetValueOrDefault("Remarks")?.ToString(), + Creater = mainData.GetValueOrDefault("Creater")?.ToString(), + CreateDate = mainData.GetValueOrDefault("CreateDate")?.ObjToDate() ?? DateTime.Now, + OrderDate = mainData.GetValueOrDefault("OrderDate")?.ObjToDate() ?? DateTime.Now, + }; + } + + /// <summary> + /// 鏍规嵁鏄庣粏鏁版嵁鍜岀敓浜у嚭搴撳崟ID鏋勫缓鐢熶骇鍑哄簱鍗曟槑缁嗗垪琛ㄣ�� + /// </summary> + private List<Dt_OutOrderProductionDetail> CreateProductionDetails(List<Dictionary<string, object>> detailData) + { + var details = new List<Dt_OutOrderProductionDetail>(); + foreach (var item in detailData) + { + var detail = new Dt_OutOrderProductionDetail + { + MaterialId = item.GetValueOrDefault("MaterialId")?.ObjToInt() ?? 0, + Quantity = item.GetValueOrDefault("Quantity")?.ObjToInt() ?? 0, + Remarks = item.GetValueOrDefault("Remarks")?.ToString(), + CreateDate = item.GetValueOrDefault("CreateDate")?.ObjToDate() ?? DateTime.Now, + Creater = item.GetValueOrDefault("Creater")?.ToString(), + BatchNumber = item.GetValueOrDefault("BatchNumber")?.ToString(), + }; + details.Add(detail); + } + return details; + } + + /// <summary> + /// 鏍规嵁鐢熶骇鍑哄簱鍗曞璞″拰鐢熶骇鍑哄簱鍗旾D鏋勫缓绯荤粺鍑哄簱鍗曞璞°�� + /// </summary> + private Dt_OutOrder CreateSystemOrder(Dt_OutOrderProduction production) + { + return new Dt_OutOrder + { + Status = production.Status, + CreateDate = DateTime.Now, + Creater = production.Creater, + OrderDate = DateTime.Now, + OrderNumber = production.OrderNumber, + Remarks = production.Remarks, + WarehouseId = production.WarehouseId, + }; + } + + /// <summary> + /// 鏍规嵁鐢熶骇鍑哄簱鍗曟槑缁嗗垪琛ㄥ拰绯荤粺鍑哄簱鍗旾D鏋勫缓绯荤粺鍑哄簱鍗曟槑缁嗗垪琛ㄣ�� + /// </summary> + private List<Dt_OutOrderDetail> CreateSystemOrderDetails(List<Dt_OutOrderProductionDetail> productionDetails) + { + var orderDetails = new List<Dt_OutOrderDetail>(); + foreach (var item in productionDetails) + { + var detail = new Dt_OutOrderDetail + { + AllocatedQuantity = 0, + BatchNumber = item.BatchNumber, + CompletedQuantity = 0, + CreateDate = item.CreateDate, + Creater = item.Creater, + MaterialId = item.MaterialId, + OutboundQuantity = item.Quantity, + Remarks = item.Remarks, + MaterialName = item.Remarks // 鐗╂枡鍚嶇О + }; + orderDetails.Add(detail); + } + return orderDetails; + } + + #endregion 鐢熶骇鍑哄簱鍗� + + #region 璋冩嫧鍑哄簱鍗� + + /// <summary> + /// 鏍规嵁涓绘暟鎹瀯寤鸿皟鎷ㄥ嚭搴撳崟瀵硅薄銆� + /// </summary> + private Dt_OutOrderTransfer CreateTransferOrder(Dictionary<string, object> mainData) + { + return new Dt_OutOrderTransfer + { + OrderNumber = mainData.GetValueOrDefault("OrderNumber")?.ToString(), + SourceWarehouseId = mainData.GetValueOrDefault("SourceWarehouseId")?.ObjToInt() ?? 0, + DestinationWarehouseId = mainData.GetValueOrDefault("WarehouseId")?.ObjToInt() ?? 0, + Status = (int)OutOrderTypeEnum.Allocate, + Remarks = mainData.GetValueOrDefault("Remarks")?.ToString(), + Creater = mainData.GetValueOrDefault("Creater")?.ToString(), + CreateDate = mainData.GetValueOrDefault("CreateDate")?.ObjToDate() ?? DateTime.Now, + OrderDate = mainData.GetValueOrDefault("OrderDate")?.ObjToDate() ?? DateTime.Now, + }; + } + + /// <summary> + /// 鏍规嵁鏄庣粏鏁版嵁鍜岃皟鎷ㄥ嚭搴撳崟ID鏋勫缓璋冩嫧鍑哄簱鍗曟槑缁嗗垪琛ㄣ�� + /// </summary> + private List<Dt_OutOrderTransferDetail> CreateTransferDetails(List<Dictionary<string, object>> detailData) + { + var details = new List<Dt_OutOrderTransferDetail>(); + foreach (var item in detailData) + { + var detail = new Dt_OutOrderTransferDetail + { + MaterialId = item.GetValueOrDefault("MaterialId")?.ObjToInt() ?? 0, + Quantity = item.GetValueOrDefault("Quantity")?.ObjToInt() ?? 0, + Remarks = item.GetValueOrDefault("Remarks")?.ToString(), + CreateDate = item.GetValueOrDefault("CreateDate")?.ObjToDate() ?? DateTime.Now, + Creater = item.GetValueOrDefault("Creater")?.ToString(), + BatchNumber = item.GetValueOrDefault("BatchNumber")?.ToString(), + }; + details.Add(detail); + } + return details; + } + + /// <summary> + /// 鏍规嵁鐢熶骇鍑哄簱鍗曞璞″拰鐢熶骇鍑哄簱鍗旾D鏋勫缓绯荤粺鍑哄簱鍗曞璞°�� + /// </summary> + private Dt_OutOrder CreateSystemOrder(Dt_OutOrderTransfer transfer) + { + return new Dt_OutOrder + { + Status = transfer.Status, + CreateDate = DateTime.Now, + Creater = transfer.Creater, + OrderDate = DateTime.Now, + OrderNumber = transfer.OrderNumber, + Remarks = transfer.Remarks, + WarehouseId = transfer.SourceWarehouseId, + }; + } + + /// <summary> + /// 鏍规嵁鐢熶骇鍑哄簱鍗曟槑缁嗗垪琛ㄥ拰绯荤粺鍑哄簱鍗旾D鏋勫缓绯荤粺鍑哄簱鍗曟槑缁嗗垪琛ㄣ�� + /// </summary> + private List<Dt_OutOrderDetail> CreateSystemOrderDetails(List<Dt_OutOrderTransferDetail> transferDetails) + { + var orderDetails = new List<Dt_OutOrderDetail>(); + foreach (var item in transferDetails) + { + var detail = new Dt_OutOrderDetail + { + AllocatedQuantity = 0, + BatchNumber = item.BatchNumber, + CompletedQuantity = 0, + CreateDate = item.CreateDate, + Creater = item.Creater, + MaterialId = item.MaterialId, + OutboundQuantity = item.Quantity, + Remarks = item.Remarks, + MaterialName = item.Remarks // 鐗╂枡鍚嶇О + }; + orderDetails.Add(detail); + } + return orderDetails; + } + + #endregion 璋冩嫧鍑哄簱鍗� + + #region 鍑哄簱鍒嗛厤 + + /// <summary> + /// 鍒涘缓浠诲姟鍒楄〃 + /// </summary> + /// <param name="order">璁㈠崟瀵硅薄</param> + /// <param name="filteredStocks">绛涢�夊悗鐨勫簱瀛樺垪琛�</param> + /// <returns>銆愪换鍔″垪琛�,鏇存柊鍒嗛厤鏁伴噺璁㈠崟,鍒涘缓浠诲姟鐨勫簱瀛樸��</returns> + private (List<Dt_Task>, Dt_OutOrder, List<DtStockInfo>) CreateTasks(Dt_OutOrder order, List<DtStockInfo> filteredStocks) + { + var tasks = new List<Dt_Task>(); + var stocks = new List<DtStockInfo>(); + + foreach (var stock in filteredStocks) + { + // 濡傛灉宸插垎閰嶆暟閲忚揪鍒板嚭搴撴暟閲忥紝鍋滄鍒嗛厤 + if (order.OrderDetailList.AllocatedQuantity >= order.OrderDetailList.OutboundQuantity) + break; + + // 濡傛灉鎵樼洏浠诲姟宸插瓨鍦紝璺宠繃 + if (_taskRepository.QueryFirst(x => x.PalletCode == stock.PalletCode) != null) + continue; + + // 鍒涘缓浠诲姟 + tasks.Add(new Dt_Task + { + CreateDate = DateTime.Now, // 鍒涘缓鏃堕棿 + Creater = App.User.UserName, // 鍒涘缓浜� + CurrentAddress = stock.LocationCode, //褰撳墠浣嶇疆 + Dispatchertime = DateTime.Now, //璋冨害鏃堕棿锛堜换鍔′笅鍙戞椂闂达級 + Grade = 1, // 绛夌骇 + MaterialNo = stock.StockInfoDetails[0].MaterielCode, // 鐗╂枡鍙� + NextAddress = stock.LocationCode, // 涓嬩竴浣嶇疆 + PalletCode = stock.PalletCode, //鎵樼洏鍙� + Remark = stock.Remark, //澶囨敞 + Roadway = stock.LocationInfo.RoadwayNo, //宸烽亾 + SourceAddress = stock.LocationCode, //鏉ユ簮浣嶇疆 + TargetAddress = order.OrderDetailList.Remarks, //鐩爣鍦板潃 + TaskNum = _taskRepository.GetTaskNo().Result, //浠诲姟鍙� + TaskState = (int)TaskOutStatusEnum.OutNew, //浠诲姟鐘舵�� + TaskType = (int)TaskTypeEnum.Outbound, //浠诲姟绫诲瀷 + }); + + // 鏇存柊宸插垎閰嶆暟閲� + order.OrderDetailList.AllocatedQuantity += stock.StockInfoDetails.Sum(x => x.StockQuantity); + stocks.Add(stock); + } + + return (tasks, order, stocks); + } + + /// <summary> + /// 鏇存柊搴撳瓨鐘舵�� + /// </summary> + /// <param name="filteredStocks">绛涢�夊悗鐨勫簱瀛樺垪琛�</param> + /// <returns>鏇存柊鍚庣殑搴撳瓨鍒楄〃</returns> + private List<DtStockInfo> UpdateStocks(List<DtStockInfo> filteredStocks) + { + var updatedStocks = new List<DtStockInfo>(); + + foreach (var stock in filteredStocks) + { + // 鏇存柊搴撳瓨鐘舵�� + stock.LocationInfo.LocationStatus = (int)LocationEnum.Lock; + stock.StockInfoDetails.ForEach(x => + { + x.Status = (int)StockStateEmun.鍑哄簱閿佸畾; + }); + updatedStocks.Add(stock); + } + + return updatedStocks; + } + + /// <summary> + /// 鍒涘缓璁㈠崟搴撳瓨鍒楄〃 + /// </summary> + /// <param name="stock">绛涢�夊悗鐨勫簱瀛樺垪琛�</param> + /// <param name="order">璁㈠崟瀵硅薄</param> + /// <returns>璁㈠崟搴撳瓨鍒楄〃</returns> + private List<Dt_OutOrderAndStock> CreateOrderStock(List<DtStockInfo> stock, Dt_OutOrder order) + { + var orderStocks = new List<Dt_OutOrderAndStock>(); + foreach (var item in stock) + { + orderStocks.Add(new Dt_OutOrderAndStock() + { + AllocatedQuantity = order.OrderDetailList.AllocatedQuantity, + MaterialNo = item.StockInfoDetails[0].MaterielCode, + MaterialName = order.OrderDetailList.MaterialName, + OrderNumber = order.OrderNumber, + OutboundQuantity = order.OrderDetailList.OutboundQuantity, + PalletCode = item.PalletCode, + PalletQuantity = item.StockInfoDetails.Sum(x => x.StockQuantity), + State = item.StockInfoDetails[0].Status, + BatchNumber = order.OrderDetailList.BatchNumber, + CompletedQuantity = order.OrderDetailList.CompletedQuantity, + Creater = App.User.UserName, + CreateDate = DateTime.Now, + GroupId = item.Id, + LocationCode = item.LocationInfo.LocationCode, + OutOrderId = order.Id, + }); + } + + return orderStocks; + } + + #endregion 鍑哄簱鍒嗛厤 + + #endregion 绉佹湁鏂规硶 +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageOutOrderServices/OutboundOrder/Dt_OutOrderTransferDetailService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageOutOrderServices/OutboundOrder/Dt_OutOrderTransferDetailService.cs" new file mode 100644 index 0000000..357877c --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageOutOrderServices/OutboundOrder/Dt_OutOrderTransferDetailService.cs" @@ -0,0 +1,11 @@ +锘縩amespace WIDESEA_StorageOutOrderServices; + +public class Dt_OutOrderTransferDetailService : ServiceBase<Dt_OutOrderTransferDetail, IDt_OutOrderTransferDetailRepository>, IDt_OutOrderTransferDetailService +{ + private readonly IUnitOfWorkManage _unitOfWorkManage; + + public Dt_OutOrderTransferDetailService(IDt_OutOrderTransferDetailRepository BaseDal, IUnitOfWorkManage unitOfWorkManage) : base(BaseDal) + { + _unitOfWorkManage = unitOfWorkManage; + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageOutOrderServices/OutboundOrder/Dt_OutOrderTransferService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageOutOrderServices/OutboundOrder/Dt_OutOrderTransferService.cs" new file mode 100644 index 0000000..c15cb50 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageOutOrderServices/OutboundOrder/Dt_OutOrderTransferService.cs" @@ -0,0 +1,11 @@ +锘縩amespace WIDESEA_StorageOutOrderServices; + +public class Dt_OutOrderTransferService : ServiceBase<Dt_OutOrderTransfer, IDt_OutOrderTransferRepository>, IDt_OutOrderTransferService +{ + private readonly IUnitOfWorkManage _unitOfWorkManage; + + public Dt_OutOrderTransferService(IDt_OutOrderTransferRepository BaseDal, IUnitOfWorkManage unitOfWorkManage) : base(BaseDal) + { + _unitOfWorkManage = unitOfWorkManage; + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskRepository/GlobalUsing.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskRepository/GlobalUsing.cs" new file mode 100644 index 0000000..564cbbf --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskRepository/GlobalUsing.cs" @@ -0,0 +1,3 @@ +锘縢lobal using WIDESEA_Core.BaseRepository; +global using WIDESEA_IStorageTaskRepository; +global using WIDESEA_Model.Models; \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskRepository/Task/Dt_TaskRepository.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskRepository/Task/Dt_TaskRepository.cs" new file mode 100644 index 0000000..d98402a --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskRepository/Task/Dt_TaskRepository.cs" @@ -0,0 +1,73 @@ +锘縩amespace WIDESEA_StorageTaskRepository; + +public class Dt_TaskRepository : RepositoryBase<Dt_Task>, IDt_TaskRepository +{ + public Dt_TaskRepository(IUnitOfWorkManage unitOfWorkManage) : base(unitOfWorkManage) + { + } + + public async Task<Dt_Task> Create(Dt_Task model) + { + return await Db.Insertable(model).ExecuteReturnEntityAsync(); + } + + public async Task<bool> Create(List<Dt_Task> models) + { + var num = Db.Insertable(models).ExecuteCommand(); + if (num == models.Count) + return await Task.FromResult(true); + else + return await Task.FromResult(false); + } + + public async Task<bool> Delete(int id) + { + return await Db.Deleteable<Dt_Task>().In(id).ExecuteCommandHasChangeAsync(); + } + + public async Task<bool> Delete(List<int> ids) + { + return await Db.Deleteable<Dt_Task>().In(ids.ToArray()).ExecuteCommandHasChangeAsync(); + } + + public async Task<Dt_Task> GetById(int id) + { + return await Db.Queryable<Dt_Task>().InSingleAsync(id); + } + + public async Task<List<Dt_Task>> GetList() + { + return await Db.Queryable<Dt_Task>().ToListAsync(); + } + + public Task<List<Dt_Task>> GetListByOutOrder(int outOrderId) + { + throw new NotImplementedException(); + } + + public Task<List<Dt_Task>> GetListByOutOrderAndStatus(int outOrderId, int status) + { + throw new NotImplementedException(); + } + + public async Task<List<Dt_Task>> GetListByStatus(int status) + { + return await Db.Queryable<Dt_Task>().Where(x => x.TaskState == status).ToListAsync(); + } + + public Task<int> GetTaskNo() + { + string sql = "select next value for dbo.GetTaskNum"; + return Db.Ado.SqlQuerySingleAsync<int>(sql); + } + + public async Task<bool> Update(Dt_Task model) + { + return await Db.Updateable(model).ExecuteCommandHasChangeAsync(); + } + + public async Task<bool> Update(List<Dt_Task> models) + { + return await Db.Updateable(models).ExecuteCommandHasChangeAsync(); + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskRepository/Task/Dt_Task_HtyRepository.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskRepository/Task/Dt_Task_HtyRepository.cs" new file mode 100644 index 0000000..68c7402 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskRepository/Task/Dt_Task_HtyRepository.cs" @@ -0,0 +1,13 @@ +锘縩amespace WIDESEA_StorageTaskRepository; + +public class Dt_Task_HtyRepository : RepositoryBase<Dt_Task_Hty>, IDt_Task_HtyRepository +{ + public Dt_Task_HtyRepository(IUnitOfWorkManage unitOfWorkManage) : base(unitOfWorkManage) + { + } + + public bool InsertTask(Dt_Task_Hty task) + { + return Db.Insertable(task).ExecuteCommand() > 0; + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskRepository/Task/TaskExecuteDetailRepository.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskRepository/Task/TaskExecuteDetailRepository.cs" new file mode 100644 index 0000000..c5dc491 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskRepository/Task/TaskExecuteDetailRepository.cs" @@ -0,0 +1,29 @@ +锘縩amespace WIDESEA_StorageTaskRepository; + +public class TaskExecuteDetailRepository : RepositoryBase<Dt_TaskExecuteDetail>, ITaskExecuteDetailRepository +{ + public TaskExecuteDetailRepository(IUnitOfWorkManage unitOfWorkManage) : base(unitOfWorkManage) + { + } + + /// <summary> + /// 娣诲姞浠诲姟鏄庣粏 + /// </summary> + /// <param name="dt_Task">浠诲姟鏁版嵁</param> + /// <param name="isManual">鏄惁浜哄伐鎿嶄綔</param> + /// <param name="message">鎵ц淇℃伅</param> + /// <returns></returns> + public async Task<bool> AddDetailAsync(Dt_Task dt_Task,bool isManual,string message) + { + Dt_TaskExecuteDetail dt_TaskExecuteDetail = new Dt_TaskExecuteDetail() + { + Creater = "System", + IsManual = isManual, + TaskId = dt_Task.TaskId, + TaskNum = dt_Task.TaskNum, + TaskState = dt_Task.TaskState, + Remark = message + }; + return await AddDataAsync(dt_TaskExecuteDetail) > 0; + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/GlobalUsing.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/GlobalUsing.cs" new file mode 100644 index 0000000..be28113 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/GlobalUsing.cs" @@ -0,0 +1,20 @@ +锘縢lobal using AutoMapper; +global using WIDESEA_Core; +global using WIDESEA_Core.Enums; +global using WIDESEA_Core.BaseRepository; +global using WIDESEA_Core.BaseServices; +global using WIDESEA_Core.Helper; +global using WIDESEA_IStorageOutOrderRepository; +global using WIDESEA_IStorageOutOrderServices; +global using WIDESEA_IStorageTaskServices; +global using WIDESEA_IStorageTaskRepository; +global using WIDESEA_Model.Models; +global using WIDESEA_IBusinessServices; +global using WIDESEA_IBusinessesRepository; +global using WIDESEA_Repository; +global using WIDESEA_IStorageBasicRepository; +global using WIDESEA_IStorageBasicService; +global using LogLibrary.Log; +global using Newtonsoft.Json; +global using WIDESEA_Common; +global using WIDESEA_DTO; \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs" new file mode 100644 index 0000000..ab8eec4 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs" @@ -0,0 +1,956 @@ +锘縰sing Autofac.Core; +using MailKit.Search; +using Mapster; +using Masuit.Tools; +using System.Diagnostics; +using System.Text.RegularExpressions; +using System.Threading.Tasks; +using WIDESEA_Core.Const; +using WIDESEA_DTO.WMS; +using WIDESEA_IServices; +using WIDESEA_IStoragIntegrationServices; +using WIDESEAWCS_BasicInfoRepository; +using WIDESEAWCS_Model.Models; +using WIDESEAWCS_QuartzJob.Models; + + +namespace WIDESEA_StorageTaskServices; + +public partial class Dt_TaskService : ServiceBase<Dt_Task, IDt_TaskRepository>, IDt_TaskService +{ + private readonly LogFactory LogFactory = new LogFactory(); + private readonly IUnitOfWorkManage _unitOfWorkManage; + private readonly IDt_Task_HtyRepository _task_HtyRepository; + private readonly IMapper _mapper; + private readonly ILocationInfoRepository _locationRepository; + private readonly ITaskExecuteDetailRepository _taskExecuteDetailRepository; + private readonly ILocationStatusChangeRecordRepository _locationStatusChangeRecordRepository; + private readonly IDt_StationManagerRepository _stationManagerRepository; + private readonly ISys_ConfigService _configService; + private readonly IDt_InWheels_mesRepository _InWheels_MesRepository; + private readonly IDt_WheelsStockRepository _WheelsStockRepository; + private readonly IDt_WheelsStock_htyRepository _WheelsStock_HtyRepository; + private readonly IDt_InWheels_mes_htyRepository _InWheels_Mes_HtyRepository; + private readonly IDt_CacheInfoRepository _CacheInfoRepository; + + public Dt_TaskService(IDt_TaskRepository BaseDal, + IUnitOfWorkManage unitOfWorkManage, + IDt_OutOrderRepository outOrderRepository, + IStockInfoRepository stockInfoRepository, + IDt_Task_HtyRepository task_HtyRepository, + IMapper mapper, + ILocationInfoRepository locationRepository, + ITaskExecuteDetailRepository taskExecuteDetailRepository, + ILocationStatusChangeRecordRepository locationStatusChangeRecordRepository, + IStockInfoDetailRepository stockInfoDetailRepository, + IDt_StationManagerRepository stationManagerRepository, + ISys_ConfigService configService, + IDt_InWheels_mesRepository inWheels_MesRepository, + IDt_WheelsStockRepository wheelsStockRepository, + IDt_WheelsStock_htyRepository wheelsStock_HtyRepository, + IDt_InWheels_mes_htyRepository inWheels_Mes_HtyRepository, + IDt_CacheInfoRepository cacheInfoRepository) : base(BaseDal) + + { + _unitOfWorkManage = unitOfWorkManage; + _task_HtyRepository = task_HtyRepository; + _mapper = mapper; + _locationRepository = locationRepository; + _taskExecuteDetailRepository = taskExecuteDetailRepository; + _locationStatusChangeRecordRepository = locationStatusChangeRecordRepository; + _stationManagerRepository = stationManagerRepository; + _configService = configService; + _InWheels_MesRepository = inWheels_MesRepository; + _WheelsStockRepository = wheelsStockRepository; + _WheelsStock_HtyRepository = wheelsStock_HtyRepository; + _InWheels_Mes_HtyRepository = inWheels_Mes_HtyRepository; + _CacheInfoRepository = cacheInfoRepository; + } + + #region 澶栭儴鎺ュ彛鏂规硶 + + + #region 绉诲簱浠诲姟瀹屾垚 + + /// <summary> + /// 绉诲簱浠诲姟瀹屾垚 + /// </summary> + /// <param name="saveModel">浠诲姟鏁版嵁鍚堥泦</param> + /// <returns>杩斿洖缁撴灉闆�</returns> + public async Task<WebResponseContent> CompleteTransferTaskAsync(Dt_Task task, Dt_WheelsStock stock) + { + WebResponseContent content = new WebResponseContent(); + try + { + // 鏇存柊璐т綅鍜屽簱瀛樹俊鎭� + (Dt_WheelsStock updateStock, DtLocationInfo locationInForm, DtLocationInfo locationInfoTo) = UpdateStockLocation(stock, task); + var taskHty = CreateHistoricalTask(task); + LogFactory.GetLog("浠诲姟瀹屾垚").InfoFormat(true, "绉诲簱浠诲姟瀹屾垚", $"璐т綅鍦板潃锛歿task.TargetAddress},淇敼鍚庡簱瀛樻暟鎹細{JsonConvert.SerializeObject(updateStock)}锛屽師鍏堣揣浣嶆暟鎹細{locationInForm}"); + + // 鎵ц鏁版嵁搴撲簨鍔� + bool isResult = await ExecuteTransaction(updateStock, taskHty, locationInForm, locationInfoTo, task.TaskId); + if (isResult) + content.OK("绉诲簱浠诲姟瀹屾垚鎴愬姛"); + else + content.Error("绉诲簱浠诲姟瀹屾垚澶辫触"); + } + catch (Exception err) + { + Console.WriteLine(err.Message.ToString()); + } + return content; + } + + #endregion 绉诲簱浠诲姟瀹屾垚 + + #region 鍏ュ簱浠诲姟瀹屾垚 + + /// <summary> + /// 瀹屾垚鍏ュ簱浠诲姟 + /// </summary> + /// <param name="task">浠诲姟鏁版嵁鍚堥泦</param> + /// <returns>杩斿洖缁撴灉闆�</returns> + public async Task<WebResponseContent> CompleteInboundTaskAsync(Dt_Task task) + { + // 鍒濆鍖栧搷搴斿唴瀹� + WebResponseContent content = new WebResponseContent(); + try + { + + // 鑾峰彇MES淇℃伅鍜岀洰鏍囦綅缃俊鎭� + var mes_Wheels = await _InWheels_MesRepository.QueryFirstNavAsync(x => x.Wheels_Num == task.PalletCode); + var locationInf = await _locationRepository.QueryFirstAsync(x => x.LocationCode == task.TargetAddress && x.RoadwayNo == task.Roadway); + + int lastStatus = locationInf.LocationStatus; + // 鏇存柊鐩爣浣嶇疆鐘舵�佷负搴撳瓨涓� + locationInf.LocationStatus = (int)LocationEnum.InStock; + + // 鍒涘缓鍘嗗彶浠诲姟瀹炰緥妯″瀷 + var taskHty = CreateHistoricalTask(task); + + // 鏍规嵁鍒涘缓搴撳瓨瀹炰緥妯″瀷 + Dt_WheelsStock wheelsStock = new Dt_WheelsStock + { + Wheels_ldtm = mes_Wheels.Wheels_ldtm, + CreateDate = DateTime.Now, + Creater = task.Creater, + Wheels_Type = mes_Wheels.Wheels_Type, + Wheels_gkcc = mes_Wheels.Wheels_gkcc, + WheelsProps = mes_Wheels.WheelsProps, + Wheels_CarNo = mes_Wheels.Wheels_CarNo, + Wheels_CarType = mes_Wheels.Wheels_CarType, + Wheels_ldxh = mes_Wheels.Wheels_ldxh, + Wheels_code = mes_Wheels.Wheels_code, + Wheels_InDate = mes_Wheels.Wheels_InDate, + Wheels_level = mes_Wheels.Wheels_level, + Wheels_Location = task.TargetAddress, + Wheels_NewOrOld = mes_Wheels.Wheels_NewOrOld, + Wheels_Num = mes_Wheels.Wheels_Num, + Wheels_psj = mes_Wheels.Wheels_psj, + Wheels_CurrentStatue = 1, + Wheels_mttype = mes_Wheels.Wheels_mttype, + Wheels_ljz = mes_Wheels.Wheels_ljz, + Wheels_ldh = mes_Wheels.Wheels_ldh, + //Wheels_SequenceNum = mes_Wheels.Wheels_SequenceNum, + Wheels_ygljz = mes_Wheels.Wheels_ygljz, + Wheels_gkzja = mes_Wheels.Wheels_gkzja, + Wheels_gkzjb = mes_Wheels.Wheels_gkzjb, + Wheels_gkzjc = mes_Wheels.Wheels_gkzjc, + + }; + + // 鎵ц鏁版嵁搴撲簨鍔� + bool isResult = await ExecuteTransaction(wheelsStock, taskHty, locationInf, task.TaskId, mes_Wheels); + if (isResult) + { + _locationStatusChangeRecordRepository.AddLocationStatusChangeRecord(locationInf, lastStatus, (int)StatusChangeTypeEnum.AutomaticStorage, task.TaskNum); + content.OK("鍏ュ簱浠诲姟瀹屾垚鎴愬姛"); + } + else + { + content.Error("鍏ュ簱浠诲姟瀹屾垚澶辫触"); + } + } + catch (Exception err) + { + // 璁板綍寮傚父淇℃伅鍒版帶鍒跺彴鍜屾棩蹇� + Console.WriteLine(err.Message.ToString()); + LogFactory.GetLog("浠诲姟瀹屾垚").Error(true, err); + content.Error(err.Message); + } + return content; + } + #endregion 鍏ュ簱浠诲姟瀹屾垚 + + #region 鍑哄簱浠诲姟瀹屾垚 + public async Task<WebResponseContent> CompleteStackTaskAsync(Dt_Task task, Dt_WheelsStock stock) + { + WebResponseContent content = new WebResponseContent(); + try + { + // 鏇存柊搴撲綅鐘舵�佷笌浠诲姟鐘舵�� + (var loc, var tas) = UpdateStockAndTaskStatus(stock, task); + var taskHty = task.Adapt<Dt_Task_Hty>(); + taskHty.FinishTime = DateTime.Now; + taskHty.OperateType = (int)OperateTypeEnum.鑷姩瀹屾垚; + + Dt_WheelsStock_hty stockInfo_Hty = stock.Adapt<Dt_WheelsStock_hty>(); + stockInfo_Hty.FinishWheelDate = DateTime.Now; + stockInfo_Hty.OperateType = (int)OperateTypeEnum.鑷姩瀹屾垚; + + // 浜嬪姟澶勭悊 + await _unitOfWorkManage.UseTranAsync(async () => + { + var isStockUpdated = await _WheelsStockRepository.DeleteDataByIdAsync(stock.Wheels_ID); //鍒犻櫎搴撳瓨 + var isLocationUpdate = await _locationRepository.UpdateDataAsync(loc); //鏇存柊搴撲綅 + //var isTaskUpdated = await BaseDal.DeleteDataByIdAsync(task.TaskId); //鍒犻櫎浠诲姟 + var isTaskAdd = await _task_HtyRepository.AddDataAsync(taskHty) > 0; //鍔犲叆鍘嗗彶浠诲姟 + var isStockHtyAdd = await _WheelsStock_HtyRepository.AddDataAsync(stockInfo_Hty); //鍔犲叆鍘嗗彶搴撳瓨 + }); + + return content.OK("浠诲姟瀹屾垚鎴愬姛", task.Remark); + } + catch (Exception err) + { + LogFactory.GetLog("浠诲姟瀹屾垚").Error(true, $"绯荤粺寮傚父锛屽紓甯镐俊鎭細{err.Message}"); + return content.Error(err.Message); + } + } + + private (DtLocationInfo, Dt_Task) UpdateStockAndTaskStatus(Dt_WheelsStock stock, Dt_Task task) + { + var location = _locationRepository.QueryFirst(x => x.LocationCode == task.SourceAddress && x.RoadwayNo == task.Roadway); + int lastStatus = location.LocationStatus; + location.LocationStatus = (int)LocationEnum.Free; + task.TaskState = (int)TaskOutStatusEnum.OutFinish; + //task.CurrentAddress = task.NextAddress; + //task.NextAddress = task.TargetAddress; + + _locationStatusChangeRecordRepository.AddLocationStatusChangeRecord(location, lastStatus, (int)StatusChangeTypeEnum.AutomaticDelivery, task.TaskNum); + + LogFactory.GetLog("浠诲姟瀹屾垚").Info(true, "鏇存柊搴撲綅鐘舵�佷笌浠诲姟鐘舵��"); + return (location, task); + } + #endregion + + #region 浠诲姟瀹屾垚 + + /// <summary> + /// 瀹屾垚浠诲姟 + /// </summary> + /// <param name="taskNum">浠诲姟缂栧彿</param> + /// <returns>杩斿洖缁撴灉闆�</returns> + public async Task<WebResponseContent> CompleteAsync(int taskNum) + { + // 鍒濆鍖栧搷搴斿唴瀹� + WebResponseContent content = new WebResponseContent(); + + // 鎻愬彇浠诲姟鏁版嵁 + LogFactory.GetLog("浠诲姟瀹屾垚").InfoFormat(true, "鎻愬彇浠诲姟鏁版嵁", $"浠诲姟鍙凤細{taskNum}"); + + // 楠岃瘉浠诲姟鏄惁瀛樺湪 + var task = await GetByTaskNum(taskNum); + if (task == null) + { + return content.Error("浠诲姟涓嶅瓨鍦�"); + } + LogFactory.GetLog("浠诲姟瀹屾垚").InfoFormat(true, "楠岃瘉浠诲姟鏄惁瀛樺湪", JsonConvert.SerializeObject(task)); + + + // 楠岃瘉搴撳瓨鏄惁瀛樺湪 + var stock = await _WheelsStockRepository.QueryFirstNavAsync(x => x.Wheels_Num == task.PalletCode); + + // 鏍规嵁浠诲姟绫诲瀷璋冪敤鐩稿簲鐨勫畬鎴愪换鍔℃柟娉� + switch (task.TaskType) + { + case (int)TaskInboundTypeEnum.Inbound: + case (int)TaskInboundTypeEnum.InWheels: + case (int)TaskInboundTypeEnum.InBrake: + LogFactory.GetLog("浠诲姟瀹屾垚").InfoFormat(true, "鍏ュ簱浠诲姟", ""); + return await CompleteInboundTaskAsync(task); + + case (int)TaskOutboundTypeEnum.Outbound: + case (int)TaskOutboundTypeEnum.OutBrake: + case (int)TaskOutboundTypeEnum.OutWheels: + LogFactory.GetLog("浠诲姟瀹屾垚").InfoFormat(true, "鍑哄簱浠诲姟", ""); + return await CompleteStackTaskAsync(task, stock); + + case (int)TaskRelocationTypeEnum.Relocation: + return await CompleteTransferTaskAsync(task, stock); + + default: + return content.Error("浠诲姟绫诲瀷涓嶅瓨鍦�"); + } + } + + #endregion 浠诲姟瀹屾垚 + + #region 璇锋眰浠诲姟鍏ュ簱 + + #region + + #endregion 璇锋眰浠诲姟鍏ュ簱 + + /// <summary> + /// 鏇存柊浠诲姟璐т綅 + /// </summary> + /// <param name="input"></param> + /// <returns></returns> + public async Task<WebResponseContent> UpdateExistingTask(RequestTaskDto input) + { + WebResponseContent content = new WebResponseContent(); + try + { + var task = await BaseDal.QueryFirstAsync(x => x.PalletCode == input.PalletCode); + if (task == null) + return content.Error($"鏆傛湭鎵惧埌銆恵input.PalletCode}銆戠殑浠诲姟"); + + return content = await UpdateExistingTask(input, task); + } + catch (Exception err) + { + return content.Error(err.Message); + } + } + + #endregion 澶栭儴鎺ュ彛鏂规硶 + + #region 璇锋眰鍑哄簱锛堝疄鐩橈級 + + + /// <summary> + /// 鍒涘缓浠诲姟DTO + /// </summary> + private WMSTaskDTO CreateTaskDTO(Dt_Task task) + { + return new WMSTaskDTO + { + TaskNum = task.TaskNum.Value, + Grade = task.Grade.Value, + PalletCode = task.PalletCode, + RoadWay = task.Roadway, + SourceAddress = task.SourceAddress, + TargetAddress = task.TargetAddress, + TaskState = task.TaskState.Value, + wheels_gkcc = task.wheels_gkcc, + wheels_mttype = task.wheels_mttype, + WheelsLX = task.WheelsLX, + WheelsNewOrOld = task.WheelsNewOrOld, + IsCheck = true, + CarType = task.CarType, + Id = 0, + TaskType = task.TaskType + }; + } + + #endregion 璇锋眰鍑哄簱锛堝疄鐩�&绌虹洏锛� + + #region 浠诲姟鐘舵�佹洿鏀� + + /// <summary> + /// 鏇存柊浠诲姟鐘舵�� + /// </summary> + /// <param name="taskNum"></param> + /// <param name="taskState"></param> + /// <returns></returns> + public async Task<WebResponseContent> UpdateTaskStatus(int taskNum, int taskState) + { + WebResponseContent content = new WebResponseContent(); + try + { + var task = await BaseDal.QueryFirstAsync(x => x.TaskNum == taskNum); + if (task == null) + return content.Error("鏈壘鍒颁换鍔�"); + + if (taskState == (int)TaskOutStatusEnum.Line_OutFinish || taskState == (int)TaskInStatusEnum.SC_InFinish) + { + var taskHty = CreateHistoricalTask(task); + await _unitOfWorkManage.UseTranAsync(async () => + { + var asb = await BaseDal.DeleteDataByIdAsync(task.TaskId); + var asbHty = await _task_HtyRepository.AddDataAsync(taskHty) > 0; + if (asb && asbHty) + content.OK(); + else + throw new Exception(); + }); + content.OK(); + } + else + { + task.TaskState = taskState; + var asb = await BaseDal.UpdateDataAsync(task); + if (asb) + content.OK(); + else + content.Error(); + } + } + catch (Exception ex) + { + content.Error(ex.Message); + } + return content; + } + + #endregion 浠诲姟鐘舵�佹洿鏀� + + #region 鎸囧畾浠诲姟鍑哄簱 + + public WebResponseContent CreateAndSendOutboundTask(SaveModel saveModel) + { + WebResponseContent content = new WebResponseContent(); + try + { + string palletCode = saveModel.MainData["palletCode"].ToString(); + string station = saveModel.MainData["station"].ToString(); + + // 鏌ヨ搴撳瓨淇℃伅 + var stockInfo = _WheelsStockRepository.QueryFirst(x => x.Wheels_code == palletCode); + if (stockInfo == null) + { + return content.Error("鏈煡璇㈠埌瀵瑰簲鐨勫簱瀛樹俊鎭�"); + } + + if (stockInfo.Wheels_CurrentStatue != 1) return content.Error("鎸囧畾澶辫触锛氬綋鍓嶇姸鎬佷笉鍏佽鎸囧畾鍑哄簱"); + + stockInfo.Wheels_CurrentStatue = 4; + + //鏌ヨ搴撲綅鏄惁閿佸畾锛� + var location = _locationRepository.QueryFirst(x => x.LocationCode == stockInfo.Wheels_Location); + + if (location.LocationStatus == (int)LocationEnum.Lock) return content.Error("搴撲綅閿佸畾,璇峰厛瑙i攣鍚庡啀鎸囧畾鍑哄簱"); + + location.LocationStatus = (int)LocationEnum.InStockDisable; + + var task = BaseDal.QueryFirst(x => x.PalletCode == palletCode); + if (task != null) + { + return content.Error($"銆恵palletCode}銆戝凡瀛樺湪浠诲姟"); + } + + CheckInfo checkInfo = new CheckInfo() + { + CarType = stockInfo.Wheels_CarType, + MTType = stockInfo.Wheels_mttype, + CheckType = stockInfo.Wheels_Type == "1" ? "1" : "2", + HubLevel = stockInfo.Wheels_level.Contains("绛夌骇") ? stockInfo.Wheels_level.Replace("绛夌骇", "") : "0", + CLTM = stockInfo.Wheels_Num, + IsCheck = true, + Standards = stockInfo.Wheels_NewOrOld + }; + + // var stationInfo = _stationManagerRepository.QueryFirst(x => x.stationChildCode == station); + + // 鍒涘缓骞舵坊鍔犱换鍔″埌鏁版嵁搴� + task = new Dt_Task + { + CarType = stockInfo.Wheels_CarType, + wheels_gkcc = stockInfo.Wheels_gkcc, + WheelsNewOrOld = stockInfo.Wheels_NewOrOld, + WheelsLX = stockInfo.Wheels_ldxh, + Grade = 1, + Roadway = "SC1", + TargetAddress = station, + Dispatchertime = DateTime.Now, + MaterialNo = "", + NextAddress = "2010", + OrderNo = null, + PalletCode = stockInfo.Wheels_Num, + wheels_mttype = stockInfo.Wheels_mttype, + SourceAddress = stockInfo.Wheels_Location, + CurrentAddress = stockInfo.Wheels_Location, + TaskState = (int)TaskOutStatusEnum.OutNew, + TaskType = (int)TaskOutboundTypeEnum.OutWheels, + TaskNum = BaseDal.GetTaskNo().Result, + Creater = "System", + CreateDate = DateTime.Now, + TaskId = 0, + task_bak1 = JsonConvert.SerializeObject(checkInfo) + }; + + // 鍒涘缓浠诲姟浼犺緭鐢ㄧ殑DTO瀵硅薄 + var taskDTO = CreateTaskDTO(task); + + // 鑾峰彇WMS IP鍦板潃鐢ㄤ簬鍙戦�佷换鍔¤姹� + var wmsIpAddress = GetWCSIpReceiveTask(); + if (wmsIpAddress == null) + { + throw new InvalidOperationException("WMS IP 鏈厤缃�"); + } + + var tasks = new List<WMSTaskDTO>() { taskDTO }; + // 鍙戦�佷换鍔¤姹傚埌WMS + var result = HttpHelper.Post(wmsIpAddress, tasks.ToJsonString()); + content = JsonConvert.DeserializeObject<WebResponseContent>(result); + if (content.Status) + { + // 娣诲姞浠诲姟鍒版暟鎹簱 + BaseDal.AddData(task); + // 鏇存柊搴撲綅浣嶇疆鐘舵�佷负涓嶅彲鐢� + _locationRepository.UpdateData(location); + _WheelsStockRepository.UpdateData(stockInfo); + } + } + catch (Exception ex) + { + Console.WriteLine($"鍙戠敓寮傚父: {ex.Message}"); + content.Error(ex.Message); + } + + return content; + } + + private string GetWCSIpReceiveTask() + { + var configs = _configService.GetConfigsByCategory(CateGoryConst.CONFIG_SYS_IPAddress); + var wmsBase = configs.FirstOrDefault(x => x.ConfigKey == SysConfigConst.WCSIPAddress)?.ConfigValue; + var ipAddress = configs.FirstOrDefault(x => x.ConfigKey == SysConfigConst.ReceiveTask)?.ConfigValue; + if (wmsBase == null || ipAddress == null) + { + return null; + } + return wmsBase + ipAddress; + } + + #endregion 鎸囧畾浠诲姟鍑哄簱 + + #endregion 澶栭儴鎺ュ彛鏂规硶 + + #region 鍐呴儴璋冪敤鏂规硶 + + /// <summary> + /// 鍒涘缓涓�涓柊鐨勪换鍔� + /// </summary> + /// <param name="model">浠诲姟妯″瀷</param> + /// <returns>鍒涘缓鐨勪换鍔�</returns> + public async Task<Dt_Task> Create(Dt_Task model) + { + return await BaseDal.Create(model); + } + + /// <summary> + /// 鎵归噺鍒涘缓浠诲姟 + /// </summary> + /// <param name="models">浠诲姟妯″瀷鍒楄〃</param> + /// <returns>鏄惁鍒涘缓鎴愬姛</returns> + public async Task<bool> Create(List<Dt_Task> models) + { + return await BaseDal.Create(models); + } + + /// <summary> + /// 鍒犻櫎涓�涓换鍔� + /// </summary> + /// <param name="id">浠诲姟ID</param> + /// <returns>鏄惁鍒犻櫎鎴愬姛</returns> + public async Task<bool> Delete(int id) + { + return await BaseDal.Delete(id); + } + + /// <summary> + /// 鎵归噺鍒犻櫎浠诲姟 + /// </summary> + /// <param name="ids">浠诲姟ID鍒楄〃</param> + /// <returns>鏄惁鍒犻櫎鎴愬姛</returns> + public async Task<bool> Delete(List<int> ids) + { + return await BaseDal.Delete(ids); + } + + public override WebResponseContent DeleteData(object[] key) + { + WebResponseContent content = new WebResponseContent(); + // 鍒涘缓鍘嗗彶浠诲姟瀹炰緥妯″瀷 + try + { + Dt_Task task = BaseDal.QueryFirst(x => x.TaskId == Convert.ToInt32(key[0])); + if (task == null) + { + return content.Error("鏈壘鍒颁换鍔′俊鎭�!"); + } + + if (task.TaskState != (int)TaskInStatusEnum.InNew && task.TaskState != (int)TaskOutStatusEnum.OutNew && task.TaskState != (int)TaskStatus.Created) + { + return content.Error("浠诲姟涓嶅浜庢柊寤虹姸鎬�,绂佹鍒犻櫎!"); + } + + var taskHtyNG = CreateHistoricalTask(task, true); + + //if (task.TaskState == (int)TaskInStatusEnum.InNew || task.TaskState == (int)TaskOutStatusEnum.OutNew) + //{ + // //if(task.TaskType == ) + //} + + // 娣诲姞鍘嗗彶浠诲姟 + var isTaskHtyAdd = _task_HtyRepository.AddData(taskHtyNG) > 0; + + // 鍒犻櫎浠诲姟鏁版嵁 + var isTaskDelete = BaseDal.Delete(task.TaskId); + + return content.OK("鍒犻櫎鎴愬姛!"); + } + catch (Exception ex) + { + return content.Error("鍒犻櫎浠诲姟寮傚父锛�" + ex.Message); + } + } + + /// <summary> + /// 閫氳繃ID鑾峰彇浠诲姟 + /// </summary> + /// <param name="id">浠诲姟ID</param> + /// <returns>浠诲姟妯″瀷</returns> + public async Task<Dt_Task> GetById(int id) + { + return await BaseDal.GetById(id); + } + + /// <summary> + /// 鑾峰彇鎵�鏈変换鍔″垪琛� + /// </summary> + /// <returns>浠诲姟妯″瀷鍒楄〃</returns> + public async Task<List<Dt_Task>> GetList() + { + return await BaseDal.GetList(); + } + + /// <summary> + /// 鏍规嵁鍑哄簱璁㈠崟ID鑾峰彇浠诲姟鍒楄〃 + /// </summary> + /// <param name="outOrderId">鍑哄簱璁㈠崟ID</param> + /// <returns>浠诲姟妯″瀷鍒楄〃</returns> + public async Task<List<Dt_Task>> GetListByOutOrder(int outOrderId) + { + return await BaseDal.GetListByOutOrder(outOrderId); + } + + /// <summary> + /// 鏍规嵁鍑哄簱璁㈠崟ID鍜岀姸鎬佽幏鍙栦换鍔″垪琛� + /// </summary> + /// <param name="outOrderId">鍑哄簱璁㈠崟ID</param> + /// <param name="status">浠诲姟鐘舵��</param> + /// <returns>浠诲姟妯″瀷鍒楄〃</returns> + public async Task<List<Dt_Task>> GetListByOutOrderAndStatus(int outOrderId, int status) + { + return await BaseDal.GetListByOutOrderAndStatus(outOrderId, status); + } + + /// <summary> + /// 鏍规嵁鐘舵�佽幏鍙栦换鍔″垪琛� + /// </summary> + /// <param name="status">浠诲姟鐘舵��</param> + /// <returns>浠诲姟妯″瀷鍒楄〃</returns> + public async Task<List<Dt_Task>> GetListByStatus(int status) + { + return await BaseDal.GetListByStatus(status); + } + + /// <summary> + /// 鏇存柊涓�涓换鍔� + /// </summary> + /// <param name="model">浠诲姟妯″瀷</param> + /// <returns>鏄惁鏇存柊鎴愬姛</returns> + public async Task<bool> Update(Dt_Task model) + { + return await BaseDal.UpdateDataAsync(model); + } + + /// <summary> + /// 鎵归噺鏇存柊浠诲姟 + /// </summary> + /// <param name="models">浠诲姟妯″瀷鍒楄〃</param> + /// <returns>鏄惁鏇存柊鎴愬姛</returns> + public async Task<bool> Update(List<Dt_Task> models) + { + return await BaseDal.UpdateDataAsync(models); + } + + /// <summary> + /// 妫�鏌ヤ换鍔℃槸鍚﹀瓨鍦� + /// </summary> + /// <param name="palletCode">鎵樼洏缂栫爜</param> + /// <returns>浠诲姟鏄惁瀛樺湪</returns> + public bool IsExist(string palletCode) + { + return Db.Queryable<Dt_Task>().Any(x => x.PalletCode == palletCode); + } + + /// <summary> + /// 鏍规嵁璐т綅ID鑾峰彇浠诲姟 + /// </summary> + /// <param name="locationID"></param> + /// <returns></returns> + public async Task<Dt_Task> GetByLocation(string locationID) + { + return await BaseDal.QueryFirstAsync(x => x.SourceAddress == locationID); + } + + /// <summary> + /// 鏍规嵁浠诲姟鍙疯幏鍙栦换鍔� + /// </summary> + /// <param name="taskNum"></param> + /// <returns></returns> + public async Task<Dt_Task> GetByTaskNum(int taskNum) + { + return await BaseDal.QueryFirstAsync(x => x.TaskNum == taskNum); + } + + #endregion 鍐呴儴璋冪敤鏂规硶 + + #region private 鍐呴儴鏂规硶 + + /// <summary> + /// 鍒涘缓鍘嗗彶浠诲姟璁板綍 + /// </summary> + /// <param name="task"></param> + /// <returns></returns> + private Dt_Task_Hty CreateHistoricalTask(Dt_Task task, bool isHand = false) + { + // 鏇存柊浠诲姟鐘舵�� + task.TaskState = task.TaskType > 199 ? (int)TaskInStatusEnum.InFinish : (int)TaskOutStatusEnum.OutFinish; + task.CurrentAddress = task.NextAddress; + + // 鍒涘缓鍘嗗彶浠诲姟 + var taskHty = _mapper.Map<Dt_Task_Hty>(task); + taskHty.FinishTime = DateTime.Now; + taskHty.TaskId = 0; + taskHty.OperateType = isHand ? (int)OperateTypeEnum.浜哄伐鍒犻櫎 : (int)OperateTypeEnum.鑷姩瀹屾垚; + taskHty.SourceId = task.TaskId; + if (isHand) + { + taskHty.Creater = App.User.UserName != null ? App.User.UserName : "System"; + } + taskHty.TaskState = task.TaskType > 199 ? (int)TaskInStatusEnum.InFinish : (int)TaskOutStatusEnum.OutFinish; + return taskHty; + } + + /// <summary> + /// 鏇存柊搴撳瓨浣嶇疆 + /// </summary> + /// <param name="stock">搴撳瓨瀵硅薄</param> + /// <param name="toLocation">鐩爣浣嶇疆</param> + // 鏇存柊搴撳瓨鍜屼綅缃俊鎭� + private (Dt_WheelsStock, DtLocationInfo, DtLocationInfo) UpdateStockLocation(Dt_WheelsStock stock, Dt_Task task) + { + //淇敼鏉ユ簮搴撲綅鍜� 鐩爣搴撲綅鐘舵�� + var fromLocation = _locationRepository.QueryFirst(x => x.LocationCode == task.SourceAddress && x.RoadwayNo == task.Roadway); + fromLocation.LocationStatus = (int)LocationEnum.Free; + var toLocation = _locationRepository.QueryFirst(x => x.LocationCode == task.TargetAddress && x.RoadwayNo == task.Roadway); + toLocation.LocationStatus = (int)LocationEnum.InStock; + + // 灏嗗簱瀛樹綅缃缃负鐩爣浣嶇疆 + stock.Wheels_Location = task.TargetAddress; + + // 杩斿洖鏇存柊鍚庣殑搴撳瓨鍜屼綅缃俊鎭� + return (stock, fromLocation, toLocation); + } + + #region 鎵ц鏁版嵁搴撲簨鍔� + /// <summary> + /// 鎵ц鏁版嵁搴撲簨鍔� + /// </summary> + /// <param name="stock">搴撳瓨瀵硅薄</param> + /// <param name="taskHty">鍘嗗彶浠诲姟瀵硅薄</param> + /// <param name="taskId">浠诲姟ID</param> + /// <returns></returns> + private async Task<bool> ExecuteTransaction(Dt_WheelsStock stock, Dt_Task_Hty taskHty, DtLocationInfo locationInfo, int taskId, Dt_InWheels_mes inWheels_Mes = null) + { + _unitOfWorkManage.BeginTran(); + try + { + var isUpdateStock = false; + var isDeleteWheelsMes = false; + + + // 娣诲姞搴撳瓨 + isUpdateStock = _WheelsStockRepository.AddData(stock) > 0; + if (inWheels_Mes != null) + { + isDeleteWheelsMes = _InWheels_MesRepository.DeleteData(inWheels_Mes); + + var wheels_Mes_Hty = inWheels_Mes.Adapt<Dt_InWheels_mes_hty>(); + + wheels_Mes_Hty.Wheels_CurrentStatue = "2"; + wheels_Mes_Hty.FinishDate = DateTime.Now; + wheels_Mes_Hty.OperateType = (int)OperateTypeEnum.鑷姩瀹屾垚; + + _InWheels_Mes_HtyRepository.AddData(wheels_Mes_Hty); + } + + + // 娣诲姞鍘嗗彶浠诲姟 + var isTaskHtyAdd = await _task_HtyRepository.AddDataAsync(taskHty) > 0; + + // 淇敼绉诲簱鍓嶈揣浣嶇姸鎬� + var isUpdateLoc = _locationRepository.UpdateData(locationInfo); + + // 鍒犻櫎浠诲姟鏁版嵁 + var isTaskDelete = await Delete(taskId); + + // 鎻愪氦鎴栧洖婊氫簨鍔� + if (isUpdateStock && isTaskHtyAdd && isTaskDelete && isUpdateLoc && isDeleteWheelsMes) + { + LogFactory.GetLog("浠诲姟瀹屾垚").InfoFormat(true, "浠诲姟瀹屾垚", $"浜嬪姟澶勭悊瀹屾垚,鎻愪氦浜嬪姟銆傛坊鍔犲巻鍙蹭换鍔★細{isTaskHtyAdd},鍒犻櫎浠诲姟鏁版嵁锛歿isTaskDelete},鏇存柊鎴栨坊鍔犲簱瀛橈細{isUpdateStock},淇敼鍏ュ簱鍓嶈揣浣嶇姸鎬侊細{isUpdateLoc}"); + _unitOfWorkManage.CommitTran(); + return true; + } + else + { + LogFactory.GetLog("浠诲姟瀹屾垚").InfoFormat(true, "浠诲姟瀹屾垚", $"鏁版嵁澶勭悊澶辫触,璇锋鏌ユ暟鎹槸鍚︽纭�,鏁版嵁鍥炴粴銆傛坊鍔犲巻鍙蹭换鍔★細{isTaskHtyAdd},鍒犻櫎浠诲姟鏁版嵁锛歿isTaskDelete},鏇存柊搴撳瓨锛歿isUpdateStock},淇敼鍏ュ簱鍓嶈揣浣嶇姸鎬侊細{isUpdateLoc}"); + _unitOfWorkManage.RollbackTran(); + return false; + } + } + catch (Exception err) + { + LogFactory.GetLog("浠诲姟瀹屾垚").InfoFormat(true, $"浠诲姟瀹屾垚,绯荤粺寮傚父锛屽紓甯镐俊鎭細{err.Message}", "鏃犲弬鏁�"); + _unitOfWorkManage.RollbackTran(); + throw; // 鎶涘嚭寮傚父浠ヤ究澶栭儴鎹曡幏 + } + } + #endregion + + #region 绉诲簱浠诲姟浜嬪姟 + + private async Task<bool> ExecuteTransaction(Dt_WheelsStock stock, Dt_Task_Hty taskHty, DtLocationInfo fromLocation, DtLocationInfo toLocation, int taskId) + { + _unitOfWorkManage.BeginTran(); + try + { + var isUpdateStock = _WheelsStockRepository.UpdateData(stock); + + // 娣诲姞鍘嗗彶浠诲姟 + var isTaskHtyAdd = await _task_HtyRepository.AddDataAsync(taskHty) > 0; + + // 淇敼绉诲簱鍓嶈揣浣嶇姸鎬� + var isUpdateLocF = _locationRepository.UpdateData(fromLocation); + var isUpdateLocT = _locationRepository.UpdateData(toLocation); + + // 鍒犻櫎浠诲姟鏁版嵁 + var isTaskDelete = await Delete(taskId); + + // 鎻愪氦鎴栧洖婊氫簨鍔� + if (isUpdateStock && isTaskHtyAdd && isTaskDelete && isUpdateLocF && isUpdateLocT) + { + LogFactory.GetLog("浠诲姟瀹屾垚").InfoFormat(true, "浠诲姟瀹屾垚", $"浜嬪姟澶勭悊瀹屾垚,鎻愪氦浜嬪姟銆傛坊鍔犲巻鍙蹭换鍔★細{isTaskHtyAdd},鍒犻櫎浠诲姟鏁版嵁锛歿isTaskDelete},鏇存柊鎴栨坊鍔犲簱瀛橈細{isUpdateStock},淇敼绉诲簱鍓嶈揣浣嶇姸鎬侊細{isUpdateLocF}"); + _unitOfWorkManage.CommitTran(); + return true; + } + else + { + LogFactory.GetLog("浠诲姟瀹屾垚").InfoFormat(true, "浠诲姟瀹屾垚", $"鏁版嵁澶勭悊澶辫触,璇锋鏌ユ暟鎹槸鍚︽纭�,鏁版嵁鍥炴粴銆傛坊鍔犲巻鍙蹭换鍔★細{isTaskHtyAdd},鍒犻櫎浠诲姟鏁版嵁锛歿isTaskDelete},鏇存柊搴撳瓨锛歿isUpdateStock},淇敼绉诲簱鍓嶈揣浣嶇姸鎬侊細{isUpdateLocF}"); + _unitOfWorkManage.RollbackTran(); + return false; + } + } + catch (Exception err) + { + LogFactory.GetLog("浠诲姟瀹屾垚").InfoFormat(true, $"浠诲姟瀹屾垚,绯荤粺寮傚父锛屽紓甯镐俊鎭細{err.Message}", "鏃犲弬鏁�"); + _unitOfWorkManage.RollbackTran(); + throw new Exception(err.Message); // 鎶涘嚭寮傚父浠ヤ究澶栭儴鎹曡幏 + } + } + + #endregion MyRegion + + #region 浠诲姟璇锋眰鏂规硶 + + + private static readonly SemaphoreSlim _semaphoreUpdate = new SemaphoreSlim(1, 1); + // 鏇存柊浠诲姟璐т綅 + + private async Task<WebResponseContent> UpdateExistingTask(RequestTaskDto input, Dt_Task task) + { + await _semaphoreUpdate.WaitAsync(); + try + { + if (task == null) + { + return new WebResponseContent().Error("浠诲姟瀵硅薄涓虹┖"); + } + + try + { + // 鍒涘缓WebResponseContent瀵硅薄 + var content = new WebResponseContent(); + + // 鑾峰彇搴撲綅 + var location = RequestLocation(input); + if (location == null) + { + return content.Error("鏃犳硶鑾峰彇璐т綅淇℃伅"); + } + + string toAddress = location.LocationCode; + int taskState = (int)TaskInStatusEnum.Line_InFinish; + int beforeStatus = location.LocationStatus; + // 鏇存柊璐т綅淇℃伅 + location.LocationStatus = (int)LocationEnum.Lock; + + // 鏇存柊浠诲姟淇℃伅 + MapTaskProperties(task, input, toAddress, taskState); + + _unitOfWorkManage.BeginTran(); + // 寮�濮嬩簨鍔� + var isResult = await UpdateTaskAsync(task, location, beforeStatus); + if (!isResult) + { + _unitOfWorkManage.RollbackTran(); + return content.Error("鏇存柊浠诲姟澶辫触"); + } + + // 鎻愪氦浜嬪姟 + _unitOfWorkManage.CommitTran(); + return content.OK(data: task); + } + catch (Exception ex) + { + // 鍥炴粴浜嬪姟 + _unitOfWorkManage.RollbackTran(); + // 杩欓噷鍙互娣诲姞鏃ュ織璁板綍 + return new WebResponseContent().Error($"鏇存柊浠诲姟鏃跺彂鐢熼敊璇�: {ex.Message}"); + } + } + catch (Exception) + { + + throw; + } + finally { _semaphoreUpdate.Release(); } + } + + private void MapTaskProperties(Dt_Task task, RequestTaskDto input, string toAddress, int taskState) + { + task.CurrentAddress = input.Position; + task.TargetAddress = toAddress; + task.NextAddress = toAddress; + task.TaskState = taskState; + } + + // 淇敼浠诲姟 + private async Task<bool> UpdateTaskAsync(Dt_Task task, DtLocationInfo location, int beforeStatus) + { + bool isResult = await BaseDal.UpdateDataAsync(task); + bool isTaskDetail = await _taskExecuteDetailRepository.AddDetailAsync(task, false, TaskDescription.GetTaskUpdateDescription(task.PalletCode, task.CurrentAddress, task.TargetAddress, TaskInStatusEnum.Line_InFinish.GetIntegralRuleTypeEnumDesc())); + + LocationChangeRecordDto changeRecordDto = new LocationChangeRecordDto() + { + AfterStatus = location.LocationStatus, + BeforeStatus = beforeStatus, + TaskNum = task.TaskNum.Value, + LocationId = location.Id, + LocationCode = location.LocationCode, + ChangeType = (int)StatusChangeTypeEnum.AutomaticStorage, + }; + + bool isUpdateChange = _locationStatusChangeRecordRepository.AddStatusChangeRecord(changeRecordDto); + bool isUpdateLo = await _locationRepository.UpdateDataAsync(location); + + return isResult && isUpdateLo && isTaskDetail; + } + #endregion 浠诲姟璇锋眰鏂规硶 + + #endregion private 鍐呴儴鏂规硶 +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_Task_HtyService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_Task_HtyService.cs" new file mode 100644 index 0000000..1b9ee8f --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_Task_HtyService.cs" @@ -0,0 +1,25 @@ +锘縩amespace WIDESEA_StorageTaskServices; + +public class Dt_Task_HtyService : ServiceBase<Dt_Task_Hty, IDt_Task_HtyRepository>, IDt_Task_HtyService +{ + private readonly IUnitOfWorkManage _unitOfWorkManage; + private readonly IDt_OutOrderService _outOrderService; + + public Dt_Task_HtyService(IDt_Task_HtyRepository BaseDal, + IUnitOfWorkManage unitOfWorkManage, + IDt_OutOrderService outOrderService) : base(BaseDal) + { + _unitOfWorkManage = unitOfWorkManage; + _outOrderService = outOrderService; + } + + /// <summary> + /// 娣诲姞鍘嗗彶浠诲姟 + /// </summary> + /// <param name="task">鍘嗗彶浠诲姟Model</param> + /// <returns>鎴愬姛/澶辫触</returns> + public bool InsertTask(Dt_Task_Hty task) + { + return BaseDal.InsertTask(task); + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Partial/Dt_TaskService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Partial/Dt_TaskService.cs" new file mode 100644 index 0000000..2191322 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Partial/Dt_TaskService.cs" @@ -0,0 +1,254 @@ +锘縰sing log4net.Core; +using Masuit.Tools; +using System.Collections.Generic; +using WIDESEA_Common; +using WIDESEA_Core.Const; +using WIDESEA_DTO.WMS; +using WIDESEA_StorageBasicRepository; +using WIDESEA_StorageTaskRepository; +using WIDESEAWCS_Model.Models; +using WIDESEAWCS_QuartzJob.Models; + +namespace WIDESEA_StorageTaskServices; + +public partial class Dt_TaskService : ServiceBase<Dt_Task, IDt_TaskRepository>, IDt_TaskService +{ + #region 璇锋眰浠诲姟鍏ュ簱 + /// <summary> + /// 璇锋眰鍏ュ簱 + /// </summary> + /// <param name="input">璇锋眰妯″瀷</param> + /// <returns>鍖呭惈浠诲姟淇℃伅鐨勫搷搴斿唴瀹�</returns> + public async Task<WebResponseContent> RequestInTask(RequestTaskDto input) + { + // 鍒涘缓涓�涓猈ebResponseContent瀵硅薄 + WebResponseContent content = new WebResponseContent(); + try + { + // 璋冪敤BaseDal.QueryFirstAsync鏂规硶锛屾煡璇换鍔� + var task = await BaseDal.QueryFirstAsync(x => x.PalletCode == input.PalletCode); + if (task != null) + { + { + WMSTaskDTO taskDTO = CreateTaskDTO(task); + return content.OK(data: taskDTO); + } + } + + //鏌ヨ鍒涘缓鐨勮溅杞俊鎭� + var inWheelsInfo = _InWheels_MesRepository.QueryFirst(x => x.Wheels_CurrentStatue == "0"); + + //鏌ヨ鍒涘缓鐨勫埗鍔ㄧ洏淇℃伅 + //var inBrakeInfo = _InWheels_MesRepository.QueryFirst(x => x.Wheels_CurrentStatue == "0"); + //if (inBrakeInfo == null) throw new Exception("褰撳墠鏃犺溅杞垨鍒跺姩鐩樺叆搴撲俊鎭�"); + + if (inWheelsInfo == null /*&& inBrakeInfo == null*/) throw new Exception("褰撳墠鏃犺溅杞垨鍒跺姩鐩樺叆搴撲俊鎭�"); + + var newtask = new Dt_Task + { + CurrentAddress = input.Position, + Grade = 1, + Roadway = input.Roadways, + TargetAddress = input.Roadways, + Dispatchertime = DateTime.Now, + MaterialNo = "", + NextAddress = input.Roadways, + OrderNo = null, + PalletCode = inWheelsInfo.Wheels_Num, + SourceAddress = input.Position, + TaskState = (int)TaskInStatusEnum.InNew, + TaskType = (int)TaskInboundTypeEnum.InWheels, //inWheelsInfo == null ? (int)TaskInboundTypeEnum.InBrake : + TaskNum = await BaseDal.GetTaskNo(), + CarType = inWheelsInfo.Wheels_CarType, + IsCheck = true, + wheels_mttype = inWheelsInfo.Wheels_mttype, + wheels_gkcc = inWheelsInfo.Wheels_gkcc, + WheelsNewOrOld = inWheelsInfo.Wheels_NewOrOld, + Creater = "Systeam" + }; + + // 灏濊瘯娣诲姞鏂颁换鍔� + if (newtask == null) return content.Error(); + var taskId = await BaseDal.AddDataAsync(newtask); + bool isResult = taskId > 0; + if (isResult) + { + // 鍒涘缓WMS浠诲姟 + WMSTaskDTO taskDTO = new WMSTaskDTO() + { + TaskNum = newtask.TaskNum.Value, + Grade = newtask.Grade.Value, + PalletCode = newtask.PalletCode, + RoadWay = newtask.Roadway, + SourceAddress = newtask.SourceAddress, + TargetAddress = newtask.TargetAddress, + TaskState = newtask.TaskState.Value, + Id = 0, + TaskType = newtask.TaskType, + wheels_mttype = newtask.wheels_mttype, + CarType = newtask.CarType, + wheels_gkcc = newtask.wheels_gkcc, + WheelsNewOrOld = newtask.WheelsNewOrOld, + IsCheck = newtask.IsCheck, + WheelsLX = newtask.WheelsLX, + }; + + inWheelsInfo.Wheels_CurrentStatue = "1"; + _InWheels_MesRepository.UpdateData(inWheelsInfo); + + content.OK(data: taskDTO); + } + else + content.Error("娣诲姞浠诲姟澶辫触"); + return content; + } + catch (Exception err) + { + // 濡傛灉鍙戠敓寮傚父锛屽垯璋冪敤content.Error鏂规硶锛岃褰曢敊璇俊鎭紝骞惰緭鍑洪敊璇俊鎭� + content.Error(err.Message); + Console.WriteLine(err.Message); + } + // 杩斿洖content + return content; + } + #endregion 璇锋眰浠诲姟鍏ュ簱 + + #region 搴撲綅鍒嗛厤 + #region 鑾峰彇璐т綅 + object objLOCK = new object(); + /// <summary> + /// 鍙屽崌搴撲綅鍒嗛厤 + /// </summary> + /// <param name="requestTask"></param> + /// <param name="locationInfos"></param> + /// <returns></returns> + public DtLocationInfo RequestLocation(RequestTaskDto requestTask, List<DtLocationInfo> locationInfos = null) + { + lock (objLOCK) + { + try + { + //List<DtLocationInfo> locations = new List<DtLocationInfo>(); + if (locationInfos == null || locationInfos.Count == 0) + { + locationInfos = _locationRepository.QueryData(x => x.LocationStatus == (int)LocationEnum.Free && x.RoadwayNo == "SC1" && x.EnalbeStatus == 1 && x.LocationType == 1); + } + + var location = GetEmptyLocation(locationInfos); + + if (location != null) + { + if (location.Depth == 2) + { + int row = location.Row; + int relativeLine = row % 2 == 1 ? row + 1 : row - 1; + + var insideLocation = _locationRepository.QueryFirst(x => x.Row == relativeLine && x.Layer == location.Layer && x.Column == location.Column); + + if (insideLocation.LocationStatus != (int)LocationEnum.Free /*|| insideLocation.EnalbeStatus ==*/ ) + { + locationInfos.Remove(location); + if (locationInfos.Count == 0) return null; + RequestLocation(requestTask, locationInfos); + } + } + } + if (location == null) + { + return null; + } + return location; + } + catch (Exception err) + { + Console.WriteLine(err.Message.ToString()); + return null; + } + } + } + + + private DtLocationInfo GetEmptyLocation(List<DtLocationInfo> dtLocationInfos) + { + var locationinfo = dtLocationInfos.Where(x => x.LocationStatus == (int)LocationEnum.Free && x.RoadwayNo == "SC1" && x.EnalbeStatus == 1 && x.LocationType == 1).OrderBy(x => x.Layer).ThenByDescending(x => x.Depth).ThenBy(x => x.Row).ThenBy(x => x.Column).FirstOrDefault(); + + return locationinfo; + } + + #endregion 鑾峰彇璐т綅 + #endregion 搴撲綅鍒嗛厤 + + + private async Task UpdateLocationAsync(DtLocationInfo info) + { + var isStockUpdated = await _locationRepository.UpdateDataAsync(info); + if (!isStockUpdated) + { + throw new Exception("搴撲綅淇℃伅鏇存柊澶辫触"); + } + } + + #region 鏇存柊妫�娴嬩换鍔� + /// <summary> + /// 鏇存柊妫�娴嬩换鍔� + /// </summary> + /// <param name="input">璇锋眰鍙傛暟</param> + /// <returns></returns> + public async Task<WebResponseContent> UpdateCheckTask(RequestTaskDto input) + { + // 鍒涘缓涓�涓猈ebResponseContent瀵硅薄 + WebResponseContent content = new WebResponseContent(); + try + { + // 璋冪敤BaseDal.QueryFirstAsync鏂规硶锛屾煡璇换鍔� + var task = await BaseDal.QueryFirstAsync(x => x.PalletCode == input.PalletCode); + if (task == null) + { + return content.Error($"鏈煡鏉$爜{input.PalletCode}浠诲姟"); + } + + task.TaskState = (int)TaskOutStatusEnum.Lien_Check; + task.CurrentAddress = input.Position; + task.NextAddress = "2021"; + + await BaseDal.Update(task); + return content.OK("鏇存柊鎴愬姛"); + } + catch (Exception err) + { + // 濡傛灉鍙戠敓寮傚父锛屽垯璋冪敤content.Error鏂规硶锛岃褰曢敊璇俊鎭紝骞惰緭鍑洪敊璇俊鎭� + content.Error(err.Message); + Console.WriteLine(err.Message); + return content; + } + } + #endregion 鏇存柊妫�娴嬩换鍔� + + #region 璇锋眰杞﹁疆娴佸悜鍒嗛厤 + /// <summary> + /// 璇锋眰杞﹁疆娴佸悜鍒嗛厤 + /// </summary> + /// <param name="input">璇锋眰鍙傛暟</param> + /// <returns></returns> + public async Task<WebResponseContent> RequestWheelsFlow(RequestTaskDto input) + { + // 鍒涘缓涓�涓猈ebResponseContent瀵硅薄 + WebResponseContent content = new WebResponseContent(); + try + { + var cacheinfo = await _CacheInfoRepository.QueryFirstAsync(x => x.czh == input.PalletCode); + + if (cacheinfo == null) throw new Exception($"鏈壘鍒皗input.PalletCode}杞﹁酱缂撳瓨浣嶄俊鎭�"); + + return content.OK(data: cacheinfo.targetAddress); + } + catch (Exception err) + { + // 濡傛灉鍙戠敓寮傚父锛屽垯璋冪敤content.Error鏂规硶锛岃褰曢敊璇俊鎭紝骞惰緭鍑洪敊璇俊鎭� + content.Error(err.Message); + Console.WriteLine($"杞﹁疆娴佸悜鍒嗛厤澶辫触:{err.Message}"); + return content; + } + } + #endregion +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/TaskExecuteDetailService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/TaskExecuteDetailService.cs" new file mode 100644 index 0000000..57ea664 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/TaskExecuteDetailService.cs" @@ -0,0 +1,13 @@ +锘縩amespace WIDESEA_StorageOutTaskServices; + +public class TaskExecuteDetailService : ServiceBase<Dt_TaskExecuteDetail, ITaskExecuteDetailRepository>, ITaskExecuteDetailService +{ + private readonly LogFactory LogFactory = new LogFactory(); + private readonly IUnitOfWorkManage _unitOfWorkManage; + + public TaskExecuteDetailService(ITaskExecuteDetailRepository BaseDal, + IUnitOfWorkManage unitOfWorkManage) : base(BaseDal) + { + _unitOfWorkManage = unitOfWorkManage; + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer.sln" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer.sln" new file mode 100644 index 0000000..bb25daf --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer.sln" @@ -0,0 +1,474 @@ +锘� +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.9.34701.34 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WIDESEA_WMSServer", "WIDESEA_WMSServer\WIDESEA_WMSServer.csproj", "{D81A65B5-47D1-40C1-8FDE-7D24FF003F51}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WIDESEA_Core", "WIDESEA_Core\WIDESEA_Core.csproj", "{111BD7AA-9749-4506-9772-79F9EF14754C}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WIDESEA_Common", "WIDESEA_Common\WIDESEA_Common.csproj", "{AF8F3D65-1D75-4B8F-AFD9-4150E591C44D}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WIDESEA_Model", "WIDESEA_Model\WIDESEA_Model.csproj", "{00CE9885-9F24-4B6C-A7E8-0DE8C9ED7128}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WIDESEA_IRepository", "WIDESEA_IRepository\WIDESEA_IRepository.csproj", "{B5C7DC02-077C-4255-A369-600D033A4C23}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WIDESEA_Repository", "WIDESEA_Repository\WIDESEA_Repository.csproj", "{41C50E65-7C73-4BD0-9773-2A74F1587EE2}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WIDESEA_IServices", "WIDESEA_IServices\WIDESEA_IServices.csproj", "{1C8F84A9-7812-4435-B833-FF26A9A3DD4C}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WIDESEA_Services", "WIDESEA_Services\WIDESEA_Services.csproj", "{F512AFDB-D45D-4979-BC8C-0BA7FBE8F583}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WIDESEA_Tasks", "WIDESEA_Tasks\WIDESEA_Tasks.csproj", "{3BDEBC2A-BDE6-439B-B0E4-DB8AC7709FF1}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Service", "Service", "{60DE2920-37C6-4C2B-A053-6B1B2DAF047A}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Repository", "Repository", "{56D014A3-EB8D-4EF5-A751-3BAA084519D0}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WIDESEA_DTO", "WIDESEA_DTO\WIDESEA_DTO.csproj", "{929DF936-042C-4EEC-8722-A831FC2F0AEA}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LogLibrary", "LogLibrary\LogLibrary.csproj", "{992DA9CB-143C-426B-B27D-E4DA3B863A99}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WIDESEA_IBusinessesRepository", "WIDESEA_IBusinessesRepository\WIDESEA_IBusinessesRepository.csproj", "{FBC88231-BC8E-4AA8-BD60-0A13FE463EF1}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WIDESEA_BusinessesRepository", "WIDESEA_BusinessesRepository\WIDESEA_BusinessesRepository.csproj", "{3DF4C096-7431-4484-BE38-28FAD8CA1540}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WIDESEA_IBusinessServices", "WIDESEA_IBusinessServices\WIDESEA_IBusinessServices.csproj", "{1E26EB6C-4AD1-4140-83FE-777218EE9DF5}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WIDESEA_BusinessServices", "WIDESEA_BusinessServices\WIDESEA_BusinessServices.csproj", "{BA78CC65-6D17-4C76-8285-DC6B6165DA17}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WIDESEA_IStorageOutOrderRepository", "WIDESEA_IStorageOutOrderRepository\WIDESEA_IStorageOutOrderRepository.csproj", "{9AA688B0-B3B1-49B9-A6E0-060E266E6EAE}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WIDESEA_StorageOutOrderRepository", "WIDESEA_StorageOutOrderRepository\WIDESEA_StorageOutOrderRepository.csproj", "{ABFDA4F8-921E-46D6-8F13-2588759B7F59}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "IService", "IService", "{A73C1AFF-FF92-4825-B607-2E908077EBA4}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Service", "Service", "{8498AA9D-CDC4-4FD2-81AE-DE6AD78F75ED}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "IRepository", "IRepository", "{B131DEBD-A555-490B-B448-46425298E427}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Repository", "Repository", "{798C4C07-A3B2-47AD-A69C-922D5217B5CA}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WIDESEA_IStorageOutOrderServices", "WIDESEA_IStorageOutOrderService\WIDESEA_IStorageOutOrderServices.csproj", "{2BB1F129-E90F-40B2-9487-FEA102EE48C4}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WIDESEA_StorageOutOrderServices", "WIDESEA_StorageOutOrderServices\WIDESEA_StorageOutOrderServices.csproj", "{B26D44F5-C265-4A24-BC9F-2261075A6F69}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WIDESEA_IStorageBasicRepository", "WIDESEA_IStorageBasicRepository\WIDESEA_IStorageBasicRepository.csproj", "{6EED8D59-8AF2-4B2E-81E9-92E2547F1B2D}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WIDESEA_IStorageTaskRepository", "WIDESEA_IStorageTaskRepository\WIDESEA_IStorageTaskRepository.csproj", "{CCF1C1DE-C80D-4476-B35F-1BF068E4185E}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WIDESEA_StorageBasicRepository", "WIDESEA_StorageBasicRepository\WIDESEA_StorageBasicRepository.csproj", "{40B47F57-BBC7-42D5-ABE4-11F0E469DF30}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WIDESEA_StorageTaskRepository", "WIDESEA_StorageTaskRepository\WIDESEA_StorageTaskRepository.csproj", "{1614316C-827D-4C2C-B9D3-A62E25AF1827}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WIDESEA_IStorageBasicServices", "WIDESEA_IStorageBasicService\WIDESEA_IStorageBasicServices.csproj", "{B8B1C352-0398-4A54-B202-D774D48367EB}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WIDESEA_IStorageTaskServices", "WIDESEA_IStorageTaskService\WIDESEA_IStorageTaskServices.csproj", "{986CA639-B3B4-4D4F-B12B-3D8FBA48B2B1}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WIDESEA_StorageBasicServices", "WIDESEA_StorageBasicServices\WIDESEA_StorageBasicServices.csproj", "{4BDE58B2-5B2E-480B-932F-D63C2A7D557C}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WIDESEA_StorageTaskServices", "WIDESEA_StorageTaskServices\WIDESEA_StorageTaskServices.csproj", "{9912BD12-4CF7-4A91-8203-47C9C125004C}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{9BA96018-EF8A-4D84-8E72-DA697FA5EAF8}" + ProjectSection(SolutionItems) = preProject + .editorconfig = .editorconfig + EndProjectSection +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WIDESEA_StoragIntegrationServices", "WIDESEA_StoragIntegrationServices\WIDESEA_StoragIntegrationServices.csproj", "{55326F38-372A-4606-B7FB-8C01BBAEC4FC}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WIDESEA_IStoragIntegrationServices", "WIDESEA_IStoragIntegrationServices\WIDESEA_IStoragIntegrationServices.csproj", "{94D572FA-810E-4897-B673-AF988FD4019E}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|x86 = Debug|x86 + Dev|Any CPU = Dev|Any CPU + Dev|x86 = Dev|x86 + Release|Any CPU = Release|Any CPU + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {D81A65B5-47D1-40C1-8FDE-7D24FF003F51}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D81A65B5-47D1-40C1-8FDE-7D24FF003F51}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D81A65B5-47D1-40C1-8FDE-7D24FF003F51}.Debug|x86.ActiveCfg = Debug|Any CPU + {D81A65B5-47D1-40C1-8FDE-7D24FF003F51}.Debug|x86.Build.0 = Debug|Any CPU + {D81A65B5-47D1-40C1-8FDE-7D24FF003F51}.Dev|Any CPU.ActiveCfg = Debug|Any CPU + {D81A65B5-47D1-40C1-8FDE-7D24FF003F51}.Dev|Any CPU.Build.0 = Debug|Any CPU + {D81A65B5-47D1-40C1-8FDE-7D24FF003F51}.Dev|x86.ActiveCfg = Debug|Any CPU + {D81A65B5-47D1-40C1-8FDE-7D24FF003F51}.Dev|x86.Build.0 = Debug|Any CPU + {D81A65B5-47D1-40C1-8FDE-7D24FF003F51}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D81A65B5-47D1-40C1-8FDE-7D24FF003F51}.Release|Any CPU.Build.0 = Release|Any CPU + {D81A65B5-47D1-40C1-8FDE-7D24FF003F51}.Release|x86.ActiveCfg = Release|Any CPU + {D81A65B5-47D1-40C1-8FDE-7D24FF003F51}.Release|x86.Build.0 = Release|Any CPU + {111BD7AA-9749-4506-9772-79F9EF14754C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {111BD7AA-9749-4506-9772-79F9EF14754C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {111BD7AA-9749-4506-9772-79F9EF14754C}.Debug|x86.ActiveCfg = Debug|Any CPU + {111BD7AA-9749-4506-9772-79F9EF14754C}.Debug|x86.Build.0 = Debug|Any CPU + {111BD7AA-9749-4506-9772-79F9EF14754C}.Dev|Any CPU.ActiveCfg = Debug|Any CPU + {111BD7AA-9749-4506-9772-79F9EF14754C}.Dev|Any CPU.Build.0 = Debug|Any CPU + {111BD7AA-9749-4506-9772-79F9EF14754C}.Dev|x86.ActiveCfg = Debug|Any CPU + {111BD7AA-9749-4506-9772-79F9EF14754C}.Dev|x86.Build.0 = Debug|Any CPU + {111BD7AA-9749-4506-9772-79F9EF14754C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {111BD7AA-9749-4506-9772-79F9EF14754C}.Release|Any CPU.Build.0 = Release|Any CPU + {111BD7AA-9749-4506-9772-79F9EF14754C}.Release|x86.ActiveCfg = Release|Any CPU + {111BD7AA-9749-4506-9772-79F9EF14754C}.Release|x86.Build.0 = Release|Any CPU + {AF8F3D65-1D75-4B8F-AFD9-4150E591C44D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {AF8F3D65-1D75-4B8F-AFD9-4150E591C44D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {AF8F3D65-1D75-4B8F-AFD9-4150E591C44D}.Debug|x86.ActiveCfg = Debug|Any CPU + {AF8F3D65-1D75-4B8F-AFD9-4150E591C44D}.Debug|x86.Build.0 = Debug|Any CPU + {AF8F3D65-1D75-4B8F-AFD9-4150E591C44D}.Dev|Any CPU.ActiveCfg = Debug|Any CPU + {AF8F3D65-1D75-4B8F-AFD9-4150E591C44D}.Dev|Any CPU.Build.0 = Debug|Any CPU + {AF8F3D65-1D75-4B8F-AFD9-4150E591C44D}.Dev|x86.ActiveCfg = Debug|Any CPU + {AF8F3D65-1D75-4B8F-AFD9-4150E591C44D}.Dev|x86.Build.0 = Debug|Any CPU + {AF8F3D65-1D75-4B8F-AFD9-4150E591C44D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {AF8F3D65-1D75-4B8F-AFD9-4150E591C44D}.Release|Any CPU.Build.0 = Release|Any CPU + {AF8F3D65-1D75-4B8F-AFD9-4150E591C44D}.Release|x86.ActiveCfg = Release|Any CPU + {AF8F3D65-1D75-4B8F-AFD9-4150E591C44D}.Release|x86.Build.0 = Release|Any CPU + {00CE9885-9F24-4B6C-A7E8-0DE8C9ED7128}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {00CE9885-9F24-4B6C-A7E8-0DE8C9ED7128}.Debug|Any CPU.Build.0 = Debug|Any CPU + {00CE9885-9F24-4B6C-A7E8-0DE8C9ED7128}.Debug|x86.ActiveCfg = Debug|Any CPU + {00CE9885-9F24-4B6C-A7E8-0DE8C9ED7128}.Debug|x86.Build.0 = Debug|Any CPU + {00CE9885-9F24-4B6C-A7E8-0DE8C9ED7128}.Dev|Any CPU.ActiveCfg = Debug|Any CPU + {00CE9885-9F24-4B6C-A7E8-0DE8C9ED7128}.Dev|Any CPU.Build.0 = Debug|Any CPU + {00CE9885-9F24-4B6C-A7E8-0DE8C9ED7128}.Dev|x86.ActiveCfg = Debug|Any CPU + {00CE9885-9F24-4B6C-A7E8-0DE8C9ED7128}.Dev|x86.Build.0 = Debug|Any CPU + {00CE9885-9F24-4B6C-A7E8-0DE8C9ED7128}.Release|Any CPU.ActiveCfg = Release|Any CPU + {00CE9885-9F24-4B6C-A7E8-0DE8C9ED7128}.Release|Any CPU.Build.0 = Release|Any CPU + {00CE9885-9F24-4B6C-A7E8-0DE8C9ED7128}.Release|x86.ActiveCfg = Release|Any CPU + {00CE9885-9F24-4B6C-A7E8-0DE8C9ED7128}.Release|x86.Build.0 = Release|Any CPU + {B5C7DC02-077C-4255-A369-600D033A4C23}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B5C7DC02-077C-4255-A369-600D033A4C23}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B5C7DC02-077C-4255-A369-600D033A4C23}.Debug|x86.ActiveCfg = Debug|Any CPU + {B5C7DC02-077C-4255-A369-600D033A4C23}.Debug|x86.Build.0 = Debug|Any CPU + {B5C7DC02-077C-4255-A369-600D033A4C23}.Dev|Any CPU.ActiveCfg = Debug|Any CPU + {B5C7DC02-077C-4255-A369-600D033A4C23}.Dev|Any CPU.Build.0 = Debug|Any CPU + {B5C7DC02-077C-4255-A369-600D033A4C23}.Dev|x86.ActiveCfg = Debug|Any CPU + {B5C7DC02-077C-4255-A369-600D033A4C23}.Dev|x86.Build.0 = Debug|Any CPU + {B5C7DC02-077C-4255-A369-600D033A4C23}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B5C7DC02-077C-4255-A369-600D033A4C23}.Release|Any CPU.Build.0 = Release|Any CPU + {B5C7DC02-077C-4255-A369-600D033A4C23}.Release|x86.ActiveCfg = Release|Any CPU + {B5C7DC02-077C-4255-A369-600D033A4C23}.Release|x86.Build.0 = Release|Any CPU + {41C50E65-7C73-4BD0-9773-2A74F1587EE2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {41C50E65-7C73-4BD0-9773-2A74F1587EE2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {41C50E65-7C73-4BD0-9773-2A74F1587EE2}.Debug|x86.ActiveCfg = Debug|Any CPU + {41C50E65-7C73-4BD0-9773-2A74F1587EE2}.Debug|x86.Build.0 = Debug|Any CPU + {41C50E65-7C73-4BD0-9773-2A74F1587EE2}.Dev|Any CPU.ActiveCfg = Debug|Any CPU + {41C50E65-7C73-4BD0-9773-2A74F1587EE2}.Dev|Any CPU.Build.0 = Debug|Any CPU + {41C50E65-7C73-4BD0-9773-2A74F1587EE2}.Dev|x86.ActiveCfg = Debug|Any CPU + {41C50E65-7C73-4BD0-9773-2A74F1587EE2}.Dev|x86.Build.0 = Debug|Any CPU + {41C50E65-7C73-4BD0-9773-2A74F1587EE2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {41C50E65-7C73-4BD0-9773-2A74F1587EE2}.Release|Any CPU.Build.0 = Release|Any CPU + {41C50E65-7C73-4BD0-9773-2A74F1587EE2}.Release|x86.ActiveCfg = Release|Any CPU + {41C50E65-7C73-4BD0-9773-2A74F1587EE2}.Release|x86.Build.0 = Release|Any CPU + {1C8F84A9-7812-4435-B833-FF26A9A3DD4C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1C8F84A9-7812-4435-B833-FF26A9A3DD4C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1C8F84A9-7812-4435-B833-FF26A9A3DD4C}.Debug|x86.ActiveCfg = Debug|Any CPU + {1C8F84A9-7812-4435-B833-FF26A9A3DD4C}.Debug|x86.Build.0 = Debug|Any CPU + {1C8F84A9-7812-4435-B833-FF26A9A3DD4C}.Dev|Any CPU.ActiveCfg = Debug|Any CPU + {1C8F84A9-7812-4435-B833-FF26A9A3DD4C}.Dev|Any CPU.Build.0 = Debug|Any CPU + {1C8F84A9-7812-4435-B833-FF26A9A3DD4C}.Dev|x86.ActiveCfg = Debug|Any CPU + {1C8F84A9-7812-4435-B833-FF26A9A3DD4C}.Dev|x86.Build.0 = Debug|Any CPU + {1C8F84A9-7812-4435-B833-FF26A9A3DD4C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1C8F84A9-7812-4435-B833-FF26A9A3DD4C}.Release|Any CPU.Build.0 = Release|Any CPU + {1C8F84A9-7812-4435-B833-FF26A9A3DD4C}.Release|x86.ActiveCfg = Release|Any CPU + {1C8F84A9-7812-4435-B833-FF26A9A3DD4C}.Release|x86.Build.0 = Release|Any CPU + {F512AFDB-D45D-4979-BC8C-0BA7FBE8F583}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F512AFDB-D45D-4979-BC8C-0BA7FBE8F583}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F512AFDB-D45D-4979-BC8C-0BA7FBE8F583}.Debug|x86.ActiveCfg = Debug|Any CPU + {F512AFDB-D45D-4979-BC8C-0BA7FBE8F583}.Debug|x86.Build.0 = Debug|Any CPU + {F512AFDB-D45D-4979-BC8C-0BA7FBE8F583}.Dev|Any CPU.ActiveCfg = Debug|Any CPU + {F512AFDB-D45D-4979-BC8C-0BA7FBE8F583}.Dev|Any CPU.Build.0 = Debug|Any CPU + {F512AFDB-D45D-4979-BC8C-0BA7FBE8F583}.Dev|x86.ActiveCfg = Debug|Any CPU + {F512AFDB-D45D-4979-BC8C-0BA7FBE8F583}.Dev|x86.Build.0 = Debug|Any CPU + {F512AFDB-D45D-4979-BC8C-0BA7FBE8F583}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F512AFDB-D45D-4979-BC8C-0BA7FBE8F583}.Release|Any CPU.Build.0 = Release|Any CPU + {F512AFDB-D45D-4979-BC8C-0BA7FBE8F583}.Release|x86.ActiveCfg = Release|Any CPU + {F512AFDB-D45D-4979-BC8C-0BA7FBE8F583}.Release|x86.Build.0 = Release|Any CPU + {3BDEBC2A-BDE6-439B-B0E4-DB8AC7709FF1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3BDEBC2A-BDE6-439B-B0E4-DB8AC7709FF1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3BDEBC2A-BDE6-439B-B0E4-DB8AC7709FF1}.Debug|x86.ActiveCfg = Debug|Any CPU + {3BDEBC2A-BDE6-439B-B0E4-DB8AC7709FF1}.Debug|x86.Build.0 = Debug|Any CPU + {3BDEBC2A-BDE6-439B-B0E4-DB8AC7709FF1}.Dev|Any CPU.ActiveCfg = Debug|Any CPU + {3BDEBC2A-BDE6-439B-B0E4-DB8AC7709FF1}.Dev|Any CPU.Build.0 = Debug|Any CPU + {3BDEBC2A-BDE6-439B-B0E4-DB8AC7709FF1}.Dev|x86.ActiveCfg = Debug|Any CPU + {3BDEBC2A-BDE6-439B-B0E4-DB8AC7709FF1}.Dev|x86.Build.0 = Debug|Any CPU + {3BDEBC2A-BDE6-439B-B0E4-DB8AC7709FF1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3BDEBC2A-BDE6-439B-B0E4-DB8AC7709FF1}.Release|Any CPU.Build.0 = Release|Any CPU + {3BDEBC2A-BDE6-439B-B0E4-DB8AC7709FF1}.Release|x86.ActiveCfg = Release|Any CPU + {3BDEBC2A-BDE6-439B-B0E4-DB8AC7709FF1}.Release|x86.Build.0 = Release|Any CPU + {929DF936-042C-4EEC-8722-A831FC2F0AEA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {929DF936-042C-4EEC-8722-A831FC2F0AEA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {929DF936-042C-4EEC-8722-A831FC2F0AEA}.Debug|x86.ActiveCfg = Debug|Any CPU + {929DF936-042C-4EEC-8722-A831FC2F0AEA}.Debug|x86.Build.0 = Debug|Any CPU + {929DF936-042C-4EEC-8722-A831FC2F0AEA}.Dev|Any CPU.ActiveCfg = Debug|Any CPU + {929DF936-042C-4EEC-8722-A831FC2F0AEA}.Dev|Any CPU.Build.0 = Debug|Any CPU + {929DF936-042C-4EEC-8722-A831FC2F0AEA}.Dev|x86.ActiveCfg = Debug|Any CPU + {929DF936-042C-4EEC-8722-A831FC2F0AEA}.Dev|x86.Build.0 = Debug|Any CPU + {929DF936-042C-4EEC-8722-A831FC2F0AEA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {929DF936-042C-4EEC-8722-A831FC2F0AEA}.Release|Any CPU.Build.0 = Release|Any CPU + {929DF936-042C-4EEC-8722-A831FC2F0AEA}.Release|x86.ActiveCfg = Release|Any CPU + {929DF936-042C-4EEC-8722-A831FC2F0AEA}.Release|x86.Build.0 = Release|Any CPU + {992DA9CB-143C-426B-B27D-E4DA3B863A99}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {992DA9CB-143C-426B-B27D-E4DA3B863A99}.Debug|Any CPU.Build.0 = Debug|Any CPU + {992DA9CB-143C-426B-B27D-E4DA3B863A99}.Debug|x86.ActiveCfg = Debug|x86 + {992DA9CB-143C-426B-B27D-E4DA3B863A99}.Debug|x86.Build.0 = Debug|x86 + {992DA9CB-143C-426B-B27D-E4DA3B863A99}.Dev|Any CPU.ActiveCfg = Dev|Any CPU + {992DA9CB-143C-426B-B27D-E4DA3B863A99}.Dev|Any CPU.Build.0 = Dev|Any CPU + {992DA9CB-143C-426B-B27D-E4DA3B863A99}.Dev|x86.ActiveCfg = Dev|x86 + {992DA9CB-143C-426B-B27D-E4DA3B863A99}.Dev|x86.Build.0 = Dev|x86 + {992DA9CB-143C-426B-B27D-E4DA3B863A99}.Release|Any CPU.ActiveCfg = Release|Any CPU + {992DA9CB-143C-426B-B27D-E4DA3B863A99}.Release|Any CPU.Build.0 = Release|Any CPU + {992DA9CB-143C-426B-B27D-E4DA3B863A99}.Release|x86.ActiveCfg = Release|x86 + {992DA9CB-143C-426B-B27D-E4DA3B863A99}.Release|x86.Build.0 = Release|x86 + {FBC88231-BC8E-4AA8-BD60-0A13FE463EF1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FBC88231-BC8E-4AA8-BD60-0A13FE463EF1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FBC88231-BC8E-4AA8-BD60-0A13FE463EF1}.Debug|x86.ActiveCfg = Debug|Any CPU + {FBC88231-BC8E-4AA8-BD60-0A13FE463EF1}.Debug|x86.Build.0 = Debug|Any CPU + {FBC88231-BC8E-4AA8-BD60-0A13FE463EF1}.Dev|Any CPU.ActiveCfg = Debug|Any CPU + {FBC88231-BC8E-4AA8-BD60-0A13FE463EF1}.Dev|Any CPU.Build.0 = Debug|Any CPU + {FBC88231-BC8E-4AA8-BD60-0A13FE463EF1}.Dev|x86.ActiveCfg = Debug|Any CPU + {FBC88231-BC8E-4AA8-BD60-0A13FE463EF1}.Dev|x86.Build.0 = Debug|Any CPU + {FBC88231-BC8E-4AA8-BD60-0A13FE463EF1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FBC88231-BC8E-4AA8-BD60-0A13FE463EF1}.Release|Any CPU.Build.0 = Release|Any CPU + {FBC88231-BC8E-4AA8-BD60-0A13FE463EF1}.Release|x86.ActiveCfg = Release|Any CPU + {FBC88231-BC8E-4AA8-BD60-0A13FE463EF1}.Release|x86.Build.0 = Release|Any CPU + {3DF4C096-7431-4484-BE38-28FAD8CA1540}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3DF4C096-7431-4484-BE38-28FAD8CA1540}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3DF4C096-7431-4484-BE38-28FAD8CA1540}.Debug|x86.ActiveCfg = Debug|Any CPU + {3DF4C096-7431-4484-BE38-28FAD8CA1540}.Debug|x86.Build.0 = Debug|Any CPU + {3DF4C096-7431-4484-BE38-28FAD8CA1540}.Dev|Any CPU.ActiveCfg = Debug|Any CPU + {3DF4C096-7431-4484-BE38-28FAD8CA1540}.Dev|Any CPU.Build.0 = Debug|Any CPU + {3DF4C096-7431-4484-BE38-28FAD8CA1540}.Dev|x86.ActiveCfg = Debug|Any CPU + {3DF4C096-7431-4484-BE38-28FAD8CA1540}.Dev|x86.Build.0 = Debug|Any CPU + {3DF4C096-7431-4484-BE38-28FAD8CA1540}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3DF4C096-7431-4484-BE38-28FAD8CA1540}.Release|Any CPU.Build.0 = Release|Any CPU + {3DF4C096-7431-4484-BE38-28FAD8CA1540}.Release|x86.ActiveCfg = Release|Any CPU + {3DF4C096-7431-4484-BE38-28FAD8CA1540}.Release|x86.Build.0 = Release|Any CPU + {1E26EB6C-4AD1-4140-83FE-777218EE9DF5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1E26EB6C-4AD1-4140-83FE-777218EE9DF5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1E26EB6C-4AD1-4140-83FE-777218EE9DF5}.Debug|x86.ActiveCfg = Debug|Any CPU + {1E26EB6C-4AD1-4140-83FE-777218EE9DF5}.Debug|x86.Build.0 = Debug|Any CPU + {1E26EB6C-4AD1-4140-83FE-777218EE9DF5}.Dev|Any CPU.ActiveCfg = Debug|Any CPU + {1E26EB6C-4AD1-4140-83FE-777218EE9DF5}.Dev|Any CPU.Build.0 = Debug|Any CPU + {1E26EB6C-4AD1-4140-83FE-777218EE9DF5}.Dev|x86.ActiveCfg = Debug|Any CPU + {1E26EB6C-4AD1-4140-83FE-777218EE9DF5}.Dev|x86.Build.0 = Debug|Any CPU + {1E26EB6C-4AD1-4140-83FE-777218EE9DF5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1E26EB6C-4AD1-4140-83FE-777218EE9DF5}.Release|Any CPU.Build.0 = Release|Any CPU + {1E26EB6C-4AD1-4140-83FE-777218EE9DF5}.Release|x86.ActiveCfg = Release|Any CPU + {1E26EB6C-4AD1-4140-83FE-777218EE9DF5}.Release|x86.Build.0 = Release|Any CPU + {BA78CC65-6D17-4C76-8285-DC6B6165DA17}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BA78CC65-6D17-4C76-8285-DC6B6165DA17}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BA78CC65-6D17-4C76-8285-DC6B6165DA17}.Debug|x86.ActiveCfg = Debug|Any CPU + {BA78CC65-6D17-4C76-8285-DC6B6165DA17}.Debug|x86.Build.0 = Debug|Any CPU + {BA78CC65-6D17-4C76-8285-DC6B6165DA17}.Dev|Any CPU.ActiveCfg = Debug|Any CPU + {BA78CC65-6D17-4C76-8285-DC6B6165DA17}.Dev|Any CPU.Build.0 = Debug|Any CPU + {BA78CC65-6D17-4C76-8285-DC6B6165DA17}.Dev|x86.ActiveCfg = Debug|Any CPU + {BA78CC65-6D17-4C76-8285-DC6B6165DA17}.Dev|x86.Build.0 = Debug|Any CPU + {BA78CC65-6D17-4C76-8285-DC6B6165DA17}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BA78CC65-6D17-4C76-8285-DC6B6165DA17}.Release|Any CPU.Build.0 = Release|Any CPU + {BA78CC65-6D17-4C76-8285-DC6B6165DA17}.Release|x86.ActiveCfg = Release|Any CPU + {BA78CC65-6D17-4C76-8285-DC6B6165DA17}.Release|x86.Build.0 = Release|Any CPU + {9AA688B0-B3B1-49B9-A6E0-060E266E6EAE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9AA688B0-B3B1-49B9-A6E0-060E266E6EAE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9AA688B0-B3B1-49B9-A6E0-060E266E6EAE}.Debug|x86.ActiveCfg = Debug|Any CPU + {9AA688B0-B3B1-49B9-A6E0-060E266E6EAE}.Debug|x86.Build.0 = Debug|Any CPU + {9AA688B0-B3B1-49B9-A6E0-060E266E6EAE}.Dev|Any CPU.ActiveCfg = Debug|Any CPU + {9AA688B0-B3B1-49B9-A6E0-060E266E6EAE}.Dev|Any CPU.Build.0 = Debug|Any CPU + {9AA688B0-B3B1-49B9-A6E0-060E266E6EAE}.Dev|x86.ActiveCfg = Debug|Any CPU + {9AA688B0-B3B1-49B9-A6E0-060E266E6EAE}.Dev|x86.Build.0 = Debug|Any CPU + {9AA688B0-B3B1-49B9-A6E0-060E266E6EAE}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9AA688B0-B3B1-49B9-A6E0-060E266E6EAE}.Release|Any CPU.Build.0 = Release|Any CPU + {9AA688B0-B3B1-49B9-A6E0-060E266E6EAE}.Release|x86.ActiveCfg = Release|Any CPU + {9AA688B0-B3B1-49B9-A6E0-060E266E6EAE}.Release|x86.Build.0 = Release|Any CPU + {ABFDA4F8-921E-46D6-8F13-2588759B7F59}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {ABFDA4F8-921E-46D6-8F13-2588759B7F59}.Debug|Any CPU.Build.0 = Debug|Any CPU + {ABFDA4F8-921E-46D6-8F13-2588759B7F59}.Debug|x86.ActiveCfg = Debug|Any CPU + {ABFDA4F8-921E-46D6-8F13-2588759B7F59}.Debug|x86.Build.0 = Debug|Any CPU + {ABFDA4F8-921E-46D6-8F13-2588759B7F59}.Dev|Any CPU.ActiveCfg = Debug|Any CPU + {ABFDA4F8-921E-46D6-8F13-2588759B7F59}.Dev|Any CPU.Build.0 = Debug|Any CPU + {ABFDA4F8-921E-46D6-8F13-2588759B7F59}.Dev|x86.ActiveCfg = Debug|Any CPU + {ABFDA4F8-921E-46D6-8F13-2588759B7F59}.Dev|x86.Build.0 = Debug|Any CPU + {ABFDA4F8-921E-46D6-8F13-2588759B7F59}.Release|Any CPU.ActiveCfg = Release|Any CPU + {ABFDA4F8-921E-46D6-8F13-2588759B7F59}.Release|Any CPU.Build.0 = Release|Any CPU + {ABFDA4F8-921E-46D6-8F13-2588759B7F59}.Release|x86.ActiveCfg = Release|Any CPU + {ABFDA4F8-921E-46D6-8F13-2588759B7F59}.Release|x86.Build.0 = Release|Any CPU + {2BB1F129-E90F-40B2-9487-FEA102EE48C4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2BB1F129-E90F-40B2-9487-FEA102EE48C4}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2BB1F129-E90F-40B2-9487-FEA102EE48C4}.Debug|x86.ActiveCfg = Debug|Any CPU + {2BB1F129-E90F-40B2-9487-FEA102EE48C4}.Debug|x86.Build.0 = Debug|Any CPU + {2BB1F129-E90F-40B2-9487-FEA102EE48C4}.Dev|Any CPU.ActiveCfg = Debug|Any CPU + {2BB1F129-E90F-40B2-9487-FEA102EE48C4}.Dev|Any CPU.Build.0 = Debug|Any CPU + {2BB1F129-E90F-40B2-9487-FEA102EE48C4}.Dev|x86.ActiveCfg = Debug|Any CPU + {2BB1F129-E90F-40B2-9487-FEA102EE48C4}.Dev|x86.Build.0 = Debug|Any CPU + {2BB1F129-E90F-40B2-9487-FEA102EE48C4}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2BB1F129-E90F-40B2-9487-FEA102EE48C4}.Release|Any CPU.Build.0 = Release|Any CPU + {2BB1F129-E90F-40B2-9487-FEA102EE48C4}.Release|x86.ActiveCfg = Release|Any CPU + {2BB1F129-E90F-40B2-9487-FEA102EE48C4}.Release|x86.Build.0 = Release|Any CPU + {B26D44F5-C265-4A24-BC9F-2261075A6F69}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B26D44F5-C265-4A24-BC9F-2261075A6F69}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B26D44F5-C265-4A24-BC9F-2261075A6F69}.Debug|x86.ActiveCfg = Debug|Any CPU + {B26D44F5-C265-4A24-BC9F-2261075A6F69}.Debug|x86.Build.0 = Debug|Any CPU + {B26D44F5-C265-4A24-BC9F-2261075A6F69}.Dev|Any CPU.ActiveCfg = Debug|Any CPU + {B26D44F5-C265-4A24-BC9F-2261075A6F69}.Dev|Any CPU.Build.0 = Debug|Any CPU + {B26D44F5-C265-4A24-BC9F-2261075A6F69}.Dev|x86.ActiveCfg = Debug|Any CPU + {B26D44F5-C265-4A24-BC9F-2261075A6F69}.Dev|x86.Build.0 = Debug|Any CPU + {B26D44F5-C265-4A24-BC9F-2261075A6F69}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B26D44F5-C265-4A24-BC9F-2261075A6F69}.Release|Any CPU.Build.0 = Release|Any CPU + {B26D44F5-C265-4A24-BC9F-2261075A6F69}.Release|x86.ActiveCfg = Release|Any CPU + {B26D44F5-C265-4A24-BC9F-2261075A6F69}.Release|x86.Build.0 = Release|Any CPU + {6EED8D59-8AF2-4B2E-81E9-92E2547F1B2D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6EED8D59-8AF2-4B2E-81E9-92E2547F1B2D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6EED8D59-8AF2-4B2E-81E9-92E2547F1B2D}.Debug|x86.ActiveCfg = Debug|Any CPU + {6EED8D59-8AF2-4B2E-81E9-92E2547F1B2D}.Debug|x86.Build.0 = Debug|Any CPU + {6EED8D59-8AF2-4B2E-81E9-92E2547F1B2D}.Dev|Any CPU.ActiveCfg = Debug|Any CPU + {6EED8D59-8AF2-4B2E-81E9-92E2547F1B2D}.Dev|Any CPU.Build.0 = Debug|Any CPU + {6EED8D59-8AF2-4B2E-81E9-92E2547F1B2D}.Dev|x86.ActiveCfg = Debug|Any CPU + {6EED8D59-8AF2-4B2E-81E9-92E2547F1B2D}.Dev|x86.Build.0 = Debug|Any CPU + {6EED8D59-8AF2-4B2E-81E9-92E2547F1B2D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6EED8D59-8AF2-4B2E-81E9-92E2547F1B2D}.Release|Any CPU.Build.0 = Release|Any CPU + {6EED8D59-8AF2-4B2E-81E9-92E2547F1B2D}.Release|x86.ActiveCfg = Release|Any CPU + {6EED8D59-8AF2-4B2E-81E9-92E2547F1B2D}.Release|x86.Build.0 = Release|Any CPU + {CCF1C1DE-C80D-4476-B35F-1BF068E4185E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CCF1C1DE-C80D-4476-B35F-1BF068E4185E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CCF1C1DE-C80D-4476-B35F-1BF068E4185E}.Debug|x86.ActiveCfg = Debug|Any CPU + {CCF1C1DE-C80D-4476-B35F-1BF068E4185E}.Debug|x86.Build.0 = Debug|Any CPU + {CCF1C1DE-C80D-4476-B35F-1BF068E4185E}.Dev|Any CPU.ActiveCfg = Debug|Any CPU + {CCF1C1DE-C80D-4476-B35F-1BF068E4185E}.Dev|Any CPU.Build.0 = Debug|Any CPU + {CCF1C1DE-C80D-4476-B35F-1BF068E4185E}.Dev|x86.ActiveCfg = Debug|Any CPU + {CCF1C1DE-C80D-4476-B35F-1BF068E4185E}.Dev|x86.Build.0 = Debug|Any CPU + {CCF1C1DE-C80D-4476-B35F-1BF068E4185E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CCF1C1DE-C80D-4476-B35F-1BF068E4185E}.Release|Any CPU.Build.0 = Release|Any CPU + {CCF1C1DE-C80D-4476-B35F-1BF068E4185E}.Release|x86.ActiveCfg = Release|Any CPU + {CCF1C1DE-C80D-4476-B35F-1BF068E4185E}.Release|x86.Build.0 = Release|Any CPU + {40B47F57-BBC7-42D5-ABE4-11F0E469DF30}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {40B47F57-BBC7-42D5-ABE4-11F0E469DF30}.Debug|Any CPU.Build.0 = Debug|Any CPU + {40B47F57-BBC7-42D5-ABE4-11F0E469DF30}.Debug|x86.ActiveCfg = Debug|Any CPU + {40B47F57-BBC7-42D5-ABE4-11F0E469DF30}.Debug|x86.Build.0 = Debug|Any CPU + {40B47F57-BBC7-42D5-ABE4-11F0E469DF30}.Dev|Any CPU.ActiveCfg = Debug|Any CPU + {40B47F57-BBC7-42D5-ABE4-11F0E469DF30}.Dev|Any CPU.Build.0 = Debug|Any CPU + {40B47F57-BBC7-42D5-ABE4-11F0E469DF30}.Dev|x86.ActiveCfg = Debug|Any CPU + {40B47F57-BBC7-42D5-ABE4-11F0E469DF30}.Dev|x86.Build.0 = Debug|Any CPU + {40B47F57-BBC7-42D5-ABE4-11F0E469DF30}.Release|Any CPU.ActiveCfg = Release|Any CPU + {40B47F57-BBC7-42D5-ABE4-11F0E469DF30}.Release|Any CPU.Build.0 = Release|Any CPU + {40B47F57-BBC7-42D5-ABE4-11F0E469DF30}.Release|x86.ActiveCfg = Release|Any CPU + {40B47F57-BBC7-42D5-ABE4-11F0E469DF30}.Release|x86.Build.0 = Release|Any CPU + {1614316C-827D-4C2C-B9D3-A62E25AF1827}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1614316C-827D-4C2C-B9D3-A62E25AF1827}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1614316C-827D-4C2C-B9D3-A62E25AF1827}.Debug|x86.ActiveCfg = Debug|Any CPU + {1614316C-827D-4C2C-B9D3-A62E25AF1827}.Debug|x86.Build.0 = Debug|Any CPU + {1614316C-827D-4C2C-B9D3-A62E25AF1827}.Dev|Any CPU.ActiveCfg = Debug|Any CPU + {1614316C-827D-4C2C-B9D3-A62E25AF1827}.Dev|Any CPU.Build.0 = Debug|Any CPU + {1614316C-827D-4C2C-B9D3-A62E25AF1827}.Dev|x86.ActiveCfg = Debug|Any CPU + {1614316C-827D-4C2C-B9D3-A62E25AF1827}.Dev|x86.Build.0 = Debug|Any CPU + {1614316C-827D-4C2C-B9D3-A62E25AF1827}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1614316C-827D-4C2C-B9D3-A62E25AF1827}.Release|Any CPU.Build.0 = Release|Any CPU + {1614316C-827D-4C2C-B9D3-A62E25AF1827}.Release|x86.ActiveCfg = Release|Any CPU + {1614316C-827D-4C2C-B9D3-A62E25AF1827}.Release|x86.Build.0 = Release|Any CPU + {B8B1C352-0398-4A54-B202-D774D48367EB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B8B1C352-0398-4A54-B202-D774D48367EB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B8B1C352-0398-4A54-B202-D774D48367EB}.Debug|x86.ActiveCfg = Debug|Any CPU + {B8B1C352-0398-4A54-B202-D774D48367EB}.Debug|x86.Build.0 = Debug|Any CPU + {B8B1C352-0398-4A54-B202-D774D48367EB}.Dev|Any CPU.ActiveCfg = Debug|Any CPU + {B8B1C352-0398-4A54-B202-D774D48367EB}.Dev|Any CPU.Build.0 = Debug|Any CPU + {B8B1C352-0398-4A54-B202-D774D48367EB}.Dev|x86.ActiveCfg = Debug|Any CPU + {B8B1C352-0398-4A54-B202-D774D48367EB}.Dev|x86.Build.0 = Debug|Any CPU + {B8B1C352-0398-4A54-B202-D774D48367EB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B8B1C352-0398-4A54-B202-D774D48367EB}.Release|Any CPU.Build.0 = Release|Any CPU + {B8B1C352-0398-4A54-B202-D774D48367EB}.Release|x86.ActiveCfg = Release|Any CPU + {B8B1C352-0398-4A54-B202-D774D48367EB}.Release|x86.Build.0 = Release|Any CPU + {986CA639-B3B4-4D4F-B12B-3D8FBA48B2B1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {986CA639-B3B4-4D4F-B12B-3D8FBA48B2B1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {986CA639-B3B4-4D4F-B12B-3D8FBA48B2B1}.Debug|x86.ActiveCfg = Debug|Any CPU + {986CA639-B3B4-4D4F-B12B-3D8FBA48B2B1}.Debug|x86.Build.0 = Debug|Any CPU + {986CA639-B3B4-4D4F-B12B-3D8FBA48B2B1}.Dev|Any CPU.ActiveCfg = Debug|Any CPU + {986CA639-B3B4-4D4F-B12B-3D8FBA48B2B1}.Dev|Any CPU.Build.0 = Debug|Any CPU + {986CA639-B3B4-4D4F-B12B-3D8FBA48B2B1}.Dev|x86.ActiveCfg = Debug|Any CPU + {986CA639-B3B4-4D4F-B12B-3D8FBA48B2B1}.Dev|x86.Build.0 = Debug|Any CPU + {986CA639-B3B4-4D4F-B12B-3D8FBA48B2B1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {986CA639-B3B4-4D4F-B12B-3D8FBA48B2B1}.Release|Any CPU.Build.0 = Release|Any CPU + {986CA639-B3B4-4D4F-B12B-3D8FBA48B2B1}.Release|x86.ActiveCfg = Release|Any CPU + {986CA639-B3B4-4D4F-B12B-3D8FBA48B2B1}.Release|x86.Build.0 = Release|Any CPU + {4BDE58B2-5B2E-480B-932F-D63C2A7D557C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4BDE58B2-5B2E-480B-932F-D63C2A7D557C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4BDE58B2-5B2E-480B-932F-D63C2A7D557C}.Debug|x86.ActiveCfg = Debug|Any CPU + {4BDE58B2-5B2E-480B-932F-D63C2A7D557C}.Debug|x86.Build.0 = Debug|Any CPU + {4BDE58B2-5B2E-480B-932F-D63C2A7D557C}.Dev|Any CPU.ActiveCfg = Debug|Any CPU + {4BDE58B2-5B2E-480B-932F-D63C2A7D557C}.Dev|Any CPU.Build.0 = Debug|Any CPU + {4BDE58B2-5B2E-480B-932F-D63C2A7D557C}.Dev|x86.ActiveCfg = Debug|Any CPU + {4BDE58B2-5B2E-480B-932F-D63C2A7D557C}.Dev|x86.Build.0 = Debug|Any CPU + {4BDE58B2-5B2E-480B-932F-D63C2A7D557C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4BDE58B2-5B2E-480B-932F-D63C2A7D557C}.Release|Any CPU.Build.0 = Release|Any CPU + {4BDE58B2-5B2E-480B-932F-D63C2A7D557C}.Release|x86.ActiveCfg = Release|Any CPU + {4BDE58B2-5B2E-480B-932F-D63C2A7D557C}.Release|x86.Build.0 = Release|Any CPU + {9912BD12-4CF7-4A91-8203-47C9C125004C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9912BD12-4CF7-4A91-8203-47C9C125004C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9912BD12-4CF7-4A91-8203-47C9C125004C}.Debug|x86.ActiveCfg = Debug|Any CPU + {9912BD12-4CF7-4A91-8203-47C9C125004C}.Debug|x86.Build.0 = Debug|Any CPU + {9912BD12-4CF7-4A91-8203-47C9C125004C}.Dev|Any CPU.ActiveCfg = Debug|Any CPU + {9912BD12-4CF7-4A91-8203-47C9C125004C}.Dev|Any CPU.Build.0 = Debug|Any CPU + {9912BD12-4CF7-4A91-8203-47C9C125004C}.Dev|x86.ActiveCfg = Debug|Any CPU + {9912BD12-4CF7-4A91-8203-47C9C125004C}.Dev|x86.Build.0 = Debug|Any CPU + {9912BD12-4CF7-4A91-8203-47C9C125004C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9912BD12-4CF7-4A91-8203-47C9C125004C}.Release|Any CPU.Build.0 = Release|Any CPU + {9912BD12-4CF7-4A91-8203-47C9C125004C}.Release|x86.ActiveCfg = Release|Any CPU + {9912BD12-4CF7-4A91-8203-47C9C125004C}.Release|x86.Build.0 = Release|Any CPU + {55326F38-372A-4606-B7FB-8C01BBAEC4FC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {55326F38-372A-4606-B7FB-8C01BBAEC4FC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {55326F38-372A-4606-B7FB-8C01BBAEC4FC}.Debug|x86.ActiveCfg = Debug|Any CPU + {55326F38-372A-4606-B7FB-8C01BBAEC4FC}.Debug|x86.Build.0 = Debug|Any CPU + {55326F38-372A-4606-B7FB-8C01BBAEC4FC}.Dev|Any CPU.ActiveCfg = Debug|Any CPU + {55326F38-372A-4606-B7FB-8C01BBAEC4FC}.Dev|Any CPU.Build.0 = Debug|Any CPU + {55326F38-372A-4606-B7FB-8C01BBAEC4FC}.Dev|x86.ActiveCfg = Debug|Any CPU + {55326F38-372A-4606-B7FB-8C01BBAEC4FC}.Dev|x86.Build.0 = Debug|Any CPU + {55326F38-372A-4606-B7FB-8C01BBAEC4FC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {55326F38-372A-4606-B7FB-8C01BBAEC4FC}.Release|Any CPU.Build.0 = Release|Any CPU + {55326F38-372A-4606-B7FB-8C01BBAEC4FC}.Release|x86.ActiveCfg = Release|Any CPU + {55326F38-372A-4606-B7FB-8C01BBAEC4FC}.Release|x86.Build.0 = Release|Any CPU + {94D572FA-810E-4897-B673-AF988FD4019E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {94D572FA-810E-4897-B673-AF988FD4019E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {94D572FA-810E-4897-B673-AF988FD4019E}.Debug|x86.ActiveCfg = Debug|Any CPU + {94D572FA-810E-4897-B673-AF988FD4019E}.Debug|x86.Build.0 = Debug|Any CPU + {94D572FA-810E-4897-B673-AF988FD4019E}.Dev|Any CPU.ActiveCfg = Debug|Any CPU + {94D572FA-810E-4897-B673-AF988FD4019E}.Dev|Any CPU.Build.0 = Debug|Any CPU + {94D572FA-810E-4897-B673-AF988FD4019E}.Dev|x86.ActiveCfg = Debug|Any CPU + {94D572FA-810E-4897-B673-AF988FD4019E}.Dev|x86.Build.0 = Debug|Any CPU + {94D572FA-810E-4897-B673-AF988FD4019E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {94D572FA-810E-4897-B673-AF988FD4019E}.Release|Any CPU.Build.0 = Release|Any CPU + {94D572FA-810E-4897-B673-AF988FD4019E}.Release|x86.ActiveCfg = Release|Any CPU + {94D572FA-810E-4897-B673-AF988FD4019E}.Release|x86.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {B5C7DC02-077C-4255-A369-600D033A4C23} = {B131DEBD-A555-490B-B448-46425298E427} + {41C50E65-7C73-4BD0-9773-2A74F1587EE2} = {798C4C07-A3B2-47AD-A69C-922D5217B5CA} + {1C8F84A9-7812-4435-B833-FF26A9A3DD4C} = {A73C1AFF-FF92-4825-B607-2E908077EBA4} + {F512AFDB-D45D-4979-BC8C-0BA7FBE8F583} = {8498AA9D-CDC4-4FD2-81AE-DE6AD78F75ED} + {FBC88231-BC8E-4AA8-BD60-0A13FE463EF1} = {B131DEBD-A555-490B-B448-46425298E427} + {3DF4C096-7431-4484-BE38-28FAD8CA1540} = {798C4C07-A3B2-47AD-A69C-922D5217B5CA} + {1E26EB6C-4AD1-4140-83FE-777218EE9DF5} = {A73C1AFF-FF92-4825-B607-2E908077EBA4} + {BA78CC65-6D17-4C76-8285-DC6B6165DA17} = {8498AA9D-CDC4-4FD2-81AE-DE6AD78F75ED} + {9AA688B0-B3B1-49B9-A6E0-060E266E6EAE} = {B131DEBD-A555-490B-B448-46425298E427} + {ABFDA4F8-921E-46D6-8F13-2588759B7F59} = {798C4C07-A3B2-47AD-A69C-922D5217B5CA} + {A73C1AFF-FF92-4825-B607-2E908077EBA4} = {60DE2920-37C6-4C2B-A053-6B1B2DAF047A} + {8498AA9D-CDC4-4FD2-81AE-DE6AD78F75ED} = {60DE2920-37C6-4C2B-A053-6B1B2DAF047A} + {B131DEBD-A555-490B-B448-46425298E427} = {56D014A3-EB8D-4EF5-A751-3BAA084519D0} + {798C4C07-A3B2-47AD-A69C-922D5217B5CA} = {56D014A3-EB8D-4EF5-A751-3BAA084519D0} + {2BB1F129-E90F-40B2-9487-FEA102EE48C4} = {A73C1AFF-FF92-4825-B607-2E908077EBA4} + {B26D44F5-C265-4A24-BC9F-2261075A6F69} = {8498AA9D-CDC4-4FD2-81AE-DE6AD78F75ED} + {6EED8D59-8AF2-4B2E-81E9-92E2547F1B2D} = {B131DEBD-A555-490B-B448-46425298E427} + {CCF1C1DE-C80D-4476-B35F-1BF068E4185E} = {B131DEBD-A555-490B-B448-46425298E427} + {40B47F57-BBC7-42D5-ABE4-11F0E469DF30} = {798C4C07-A3B2-47AD-A69C-922D5217B5CA} + {1614316C-827D-4C2C-B9D3-A62E25AF1827} = {798C4C07-A3B2-47AD-A69C-922D5217B5CA} + {B8B1C352-0398-4A54-B202-D774D48367EB} = {A73C1AFF-FF92-4825-B607-2E908077EBA4} + {986CA639-B3B4-4D4F-B12B-3D8FBA48B2B1} = {A73C1AFF-FF92-4825-B607-2E908077EBA4} + {4BDE58B2-5B2E-480B-932F-D63C2A7D557C} = {8498AA9D-CDC4-4FD2-81AE-DE6AD78F75ED} + {9912BD12-4CF7-4A91-8203-47C9C125004C} = {8498AA9D-CDC4-4FD2-81AE-DE6AD78F75ED} + {55326F38-372A-4606-B7FB-8C01BBAEC4FC} = {8498AA9D-CDC4-4FD2-81AE-DE6AD78F75ED} + {94D572FA-810E-4897-B673-AF988FD4019E} = {A73C1AFF-FF92-4825-B607-2E908077EBA4} + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {599A7267-7402-4143-84AE-9B407FC2BB69} + EndGlobalSection +EndGlobal diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/APP/ToAPPController.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/APP/ToAPPController.cs" new file mode 100644 index 0000000..72121c2 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/APP/ToAPPController.cs" @@ -0,0 +1,44 @@ +锘縰sing AutoMapper.Configuration.Annotations; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using WIDESEA_Core.BaseController; +using WIDESEA_DTO; +using WIDESEA_IStoragIntegrationServices; + +namespace WIDESEA_WMSServer.Controllers; + +[Route("api/[controller]")] +[ApiController] +public class ToAPPController : Controller +{ + private readonly IToAPPService _AppService; + private readonly IHttpContextAccessor _httpContextAccessor; + + public ToAPPController(IToAPPService appervice, IHttpContextAccessor httpContextAccessor) + { + _httpContextAccessor = httpContextAccessor; + _AppService = appervice; + } + + /// <summary> + /// 淇濆瓨杞﹁疆淇℃伅 + /// </summary> + /// <param name="input"></param> + /// <returns></returns> + [HttpPost, Route("SaveCLinfo"), AllowAnonymous] + public WebResponseContent SaveCLinfo([FromBody] SaveModel input) + { + return _AppService.SaveCLinfo(input); + } + + /// <summary> + /// 淇濆瓨杞﹁酱淇℃伅 + /// </summary> + /// <param name="input"></param> + /// <returns></returns> + [HttpPost, Route("SaveCZInfo"), AllowAnonymous] + public WebResponseContent SaveCZInfo([FromBody] SaveModel input) + { + return _AppService.SaveCZInfo(input); + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Basic/BoxingInfoController.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Basic/BoxingInfoController.cs" new file mode 100644 index 0000000..a5559b3 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Basic/BoxingInfoController.cs" @@ -0,0 +1,17 @@ +锘縩amespace WIDESEA_WMSServer.Controllers; + +[Route("api/[controller]")] +[ApiController] +public class BoxingInfoController : ApiBaseController<IBoxingInfoService, DtBoxingInfo> +{ + public BoxingInfoController(IBoxingInfoService service) : base(service) + { + } + + // POST api/<BoxingInfoController> + [HttpPost, Route("AddBoxingInfo"), AllowAnonymous] + public Task<WebResponseContent> AddBoxingInfoAsync([FromBody] DtBoxingInfo boxingInfo) + { + return Service.AddBoxingInfoAsync(boxingInfo); + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Basic/Dt_CZInfo_mesController.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Basic/Dt_CZInfo_mesController.cs" new file mode 100644 index 0000000..ef695e7 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Basic/Dt_CZInfo_mesController.cs" @@ -0,0 +1,11 @@ +锘縩amespace WIDESEA_WMSServer.Controllers; + +[Route("api/[controller]")] +[ApiController] +public class Dt_CZInfo_mesController : ApiBaseController<IDt_CZInfo_mesService, Dt_CZInfo_mes> +{ + public Dt_CZInfo_mesController(IDt_CZInfo_mesService service) : base(service) + { + } + +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Basic/Dt_CZInfo_mes_htyController.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Basic/Dt_CZInfo_mes_htyController.cs" new file mode 100644 index 0000000..624be16 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Basic/Dt_CZInfo_mes_htyController.cs" @@ -0,0 +1,11 @@ +锘縩amespace WIDESEA_WMSServer.Controllers; + +[Route("api/[controller]")] +[ApiController] +public class Dt_CZInfo_mes_htyController : ApiBaseController<IDt_CZInfo_mes_htyService, Dt_CZInfo_mes_hty> +{ + public Dt_CZInfo_mes_htyController(IDt_CZInfo_mes_htyService service) : base(service) + { + } + +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Basic/Dt_InWheels_mesController.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Basic/Dt_InWheels_mesController.cs" new file mode 100644 index 0000000..c9c9fa6 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Basic/Dt_InWheels_mesController.cs" @@ -0,0 +1,11 @@ +锘縩amespace WIDESEA_WMSServer.Controllers; + +[Route("api/[controller]")] +[ApiController] +public class Dt_InWheels_mesController : ApiBaseController<IDt_InWheels_mesService, Dt_InWheels_mes> +{ + public Dt_InWheels_mesController(IDt_InWheels_mesService service) : base(service) + { + } + +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Basic/Dt_InWheels_mes_htyController.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Basic/Dt_InWheels_mes_htyController.cs" new file mode 100644 index 0000000..db66729 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Basic/Dt_InWheels_mes_htyController.cs" @@ -0,0 +1,11 @@ +锘縩amespace WIDESEA_WMSServer.Controllers; + +[Route("api/[controller]")] +[ApiController] +public class Dt_InWheels_mes_htyController : ApiBaseController<IDt_InWheels_mes_htyService, Dt_InWheels_mes_hty> +{ + public Dt_InWheels_mes_htyController(IDt_InWheels_mes_htyService service) : base(service) + { + } + +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Basic/LocationInfoController.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Basic/LocationInfoController.cs" new file mode 100644 index 0000000..5d5dd64 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Basic/LocationInfoController.cs" @@ -0,0 +1,39 @@ +锘縰sing Masuit.Tools.Models; +using WIDESEA_DTO; + +namespace WIDESEA_WMSServer.Controllers; + +[Route("api/LocationInfo")] +[ApiController] +public class LocationInfoController : ApiBaseController<ILocationInfoService, DtLocationInfo> +{ + public LocationInfoController(ILocationInfoService service) : base(service) + { + } + + /// <summary> + /// 鍒涘缓鍘熷璐т綅 + /// </summary> + /// <param name="x">琛�</param> + /// <param name="y">鍒�</param> + /// <param name="z">灞�</param> + /// <param name="locType">璐т綅绫诲瀷锛�1銆佸崟娣憋紝2銆佸弻娣憋級</param> + /// <param name="areaId">鍖哄煙涓婚敭</param> + /// <returns></returns> + [HttpPost, AllowAnonymous, Route("CreateLocation")] + public WebResponseContent CreateLocation(int x, int y, int z, int locType, int areaId) + { + return Service.CreateLocation(x, y, z, locType, areaId); + } + [HttpPost, AllowAnonymous, Route("initializeLocation")] + public async Task<WebResponseContent> initializeLocation(int locationID) + { + return await Service.initializeLocation(locationID); + } + + [HttpPost, AllowAnonymous, Route("LocationEnable")] + public WebResponseContent LocationEnable([FromBody] SaveModel saveModel) + { + return Service.LocationEnable(saveModel); + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Basic/LocationStatusChangeRecordController.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Basic/LocationStatusChangeRecordController.cs" new file mode 100644 index 0000000..3a2b840 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Basic/LocationStatusChangeRecordController.cs" @@ -0,0 +1,10 @@ +锘縩amespace WIDESEA_WMSServer.Controllers; + +[Route("api/LocationStatusChangeRecord")] +[ApiController] +public class LocationStatusChangeRecordController : ApiBaseController<ILocationStatusChangeRecordService, DtLocationStatusChangeRecord> +{ + public LocationStatusChangeRecordController(ILocationStatusChangeRecordService service) : base(service) + { + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Basic/StockInfoController.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Basic/StockInfoController.cs" new file mode 100644 index 0000000..ddec94f --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Basic/StockInfoController.cs" @@ -0,0 +1,12 @@ +锘縰sing WIDESEA_IStorageBasicService; + +namespace WIDESEA_WMSServer.Controllers; + +[Route("api/StockInfo")] +[ApiController] +public class StockInfoController : ApiBaseController<IStockInfoService, DtStockInfo> +{ + public StockInfoController(IStockInfoService service) : base(service) + { + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Basic/StockInfoDetailController.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Basic/StockInfoDetailController.cs" new file mode 100644 index 0000000..f6be0c0 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Basic/StockInfoDetailController.cs" @@ -0,0 +1,12 @@ +锘縰sing WIDESEA_IStorageBasicService; + +namespace WIDESEA_WMSServer.Controllers; + +[Route("api/StockInfoDetail")] +[ApiController] +public class StockInfoDetailController : ApiBaseController<IStockInfoDetailService, DtStockInfoDetail> +{ + public StockInfoDetailController(IStockInfoDetailService service) : base(service) + { + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/BasicInfo/Dt_SelectionStandardsController.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/BasicInfo/Dt_SelectionStandardsController.cs" new file mode 100644 index 0000000..97ea167 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/BasicInfo/Dt_SelectionStandardsController.cs" @@ -0,0 +1,22 @@ +锘縰sing Microsoft.AspNetCore.Mvc; +using WIDESEA_BusinessServices; +using WIDESEA_Core.BaseController; +using WIDESEA_IBusinessServices; +using WIDESEA_Model.Models; +using WIDESEAWCS_BasicInfoService; +using WIDESEAWCS_Model.Models; + +namespace WIDESEA_WMSServer.Controllers +{ + [Route("api/Dt_SelectionStandards")] + [ApiController] + public class Dt_SelectionStandardsController : ApiBaseController<IDt_SelectionStandardsService, Dt_SelectionStandards> + { + private readonly IHttpContextAccessor _httpContextAccessor; + public Dt_SelectionStandardsController(IDt_SelectionStandardsService service, IHttpContextAccessor httpContextAccessor) : base(service) + { + _httpContextAccessor = httpContextAccessor; + } + + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/BasicInfo/Dt_StationManagerController.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/BasicInfo/Dt_StationManagerController.cs" new file mode 100644 index 0000000..167b7c9 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/BasicInfo/Dt_StationManagerController.cs" @@ -0,0 +1,22 @@ +锘縰sing Microsoft.AspNetCore.Mvc; +using WIDESEA_BusinessServices; +using WIDESEA_Core.BaseController; +using WIDESEA_IBusinessServices; +using WIDESEA_Model.Models; +using WIDESEAWCS_BasicInfoService; +using WIDESEAWCS_Model.Models; + +namespace WIDESEA_WMSServer.Controllers +{ + [Route("api/Dt_StationManager")] + [ApiController] + public class Dt_StationManagerController : ApiBaseController<IDt_StationManagerService, Dt_StationManager> + { + private readonly IHttpContextAccessor _httpContextAccessor; + public Dt_StationManagerController(IDt_StationManagerService service, IHttpContextAccessor httpContextAccessor) : base(service) + { + _httpContextAccessor = httpContextAccessor; + } + + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/BasicInfo/Dt_TraintypeController.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/BasicInfo/Dt_TraintypeController.cs" new file mode 100644 index 0000000..2a76215 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/BasicInfo/Dt_TraintypeController.cs" @@ -0,0 +1,22 @@ +锘縰sing Microsoft.AspNetCore.Mvc; +using WIDESEA_BusinessServices; +using WIDESEA_Core.BaseController; +using WIDESEA_IBusinessServices; +using WIDESEA_Model.Models; +using WIDESEAWCS_BasicInfoService; +using WIDESEAWCS_Model.Models; + +namespace WIDESEA_WMSServer.Controllers +{ + [Route("api/Dt_Traintype")] + [ApiController] + public class Dt_TraintypeController : ApiBaseController<IDt_TraintypeService, Dt_Traintype> + { + private readonly IHttpContextAccessor _httpContextAccessor; + public Dt_TraintypeController(IDt_TraintypeService service, IHttpContextAccessor httpContextAccessor) : base(service) + { + _httpContextAccessor = httpContextAccessor; + } + + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/BasicInfo/dt_needBarcodeController.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/BasicInfo/dt_needBarcodeController.cs" new file mode 100644 index 0000000..63f5557 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/BasicInfo/dt_needBarcodeController.cs" @@ -0,0 +1,22 @@ +锘縰sing Microsoft.AspNetCore.Mvc; +using WIDESEA_BusinessServices; +using WIDESEA_Core.BaseController; +using WIDESEA_IBusinessServices; +using WIDESEA_Model.Models; +using WIDESEAWCS_BasicInfoService; +using WIDESEAWCS_Model.Models; + +namespace WIDESEA_WMSServer.Controllers +{ + [Route("api/dt_needBarcode")] + [ApiController] + public class dt_needBarcodeController : ApiBaseController<Idt_needBarcodeService, dt_needBarcode> + { + private readonly IHttpContextAccessor _httpContextAccessor; + public dt_needBarcodeController(Idt_needBarcodeService service, IHttpContextAccessor httpContextAccessor) : base(service) + { + _httpContextAccessor = httpContextAccessor; + } + + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/CacheInfo/Dt_CacheInfoController.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/CacheInfo/Dt_CacheInfoController.cs" new file mode 100644 index 0000000..9890f72 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/CacheInfo/Dt_CacheInfoController.cs" @@ -0,0 +1,26 @@ +锘縰sing Microsoft.AspNetCore.Http; +using WIDESEA_StoragIntegrationServices; + +namespace WIDESEA_WMSServer.Controllers; + +[Route("api/[controller]")] +[ApiController] +public class Dt_CacheInfoController : ApiBaseController<IDt_CacheInfoService, Dt_CacheInfo> +{ + private readonly IDt_CacheInfoService _CacheInfoService; + public Dt_CacheInfoController(IDt_CacheInfoService service) : base(service) + { + _CacheInfoService = service; + } + + /// <summary> + /// 鎸囧畾缂撳瓨鏋� + /// </summary> + /// <param name="input"></param> + /// <returns></returns> + [HttpPost, Route("AddCacheInfoByAPP"), AllowAnonymous] + public WebResponseContent AddCacheInfoByAPP([FromBody] SaveModel input) + { + return _CacheInfoService.AddCacheInfoByAPP(input); + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Check/Dt_CheckResultController.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Check/Dt_CheckResultController.cs" new file mode 100644 index 0000000..1ec96b5 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Check/Dt_CheckResultController.cs" @@ -0,0 +1,26 @@ +锘縰sing WIDESEA_IStorageBasicService; +using WIDESEA_StorageTaskServices; + +namespace WIDESEA_WMSServer.Controllers; + +[Route("api/Dt_CheckResult")] +[ApiController] +public class Dt_CheckResultController : ApiBaseController<IDt_CheckResultService, Dt_CheckResult> +{ + private readonly IDt_CheckResultService _Dt_CheckResultService; + public Dt_CheckResultController(IDt_CheckResultService service) : base(service) + { + _Dt_CheckResultService = service; + } + + /// <summary> + /// 鎵嬪姩琛ュ綍鏁版嵁 + /// </summary> + /// <param name="id"></param> + /// <returns></returns> + [HttpGet, Route("HandUploadData"), AllowAnonymous] + public WebResponseContent HandUploadData(int id) + { + return _Dt_CheckResultService.HandUploadData(id); + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Check/ToCheckController.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Check/ToCheckController.cs" new file mode 100644 index 0000000..a08b651 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Check/ToCheckController.cs" @@ -0,0 +1,44 @@ +锘縰sing AutoMapper.Configuration.Annotations; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using WIDESEA_Core.BaseController; +using WIDESEA_DTO; +using WIDESEA_IStoragIntegrationServices; + +namespace WIDESEA_WMSServer.Controllers; + +[Route("api/[controller]")] +[ApiController] +public class ToCheckController : Controller +{ + private readonly IToCheckService _AppService; + private readonly IHttpContextAccessor _httpContextAccessor; + + public ToCheckController(IToCheckService appervice, IHttpContextAccessor httpContextAccessor) + { + _httpContextAccessor = httpContextAccessor; + _AppService = appervice; + } + + /// <summary> + /// 鑾峰彇杞﹁疆淇℃伅 + /// </summary> + /// <param name="input"></param> + /// <returns></returns> + [HttpPost, Route("GetCheckInfo"), AllowAnonymous] + public WebResponseContent GetCheckInfo([FromBody]object jsondata) + { + return _AppService.GetCheckInfo(jsondata); + } + + /// <summary> + /// 涓婁紶妫�娴嬫祴閲忔暟鎹� + /// </summary> + /// <param name="input"></param> + /// <returns></returns> + [HttpPost, Route("UploadCheckResult"), AllowAnonymous] + public WebResponseContent UploadCheckResult([FromBody] object json) + { + return _AppService.UploadCheckResult(json); + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Dt_AreaInfoController.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Dt_AreaInfoController.cs" new file mode 100644 index 0000000..bea58f0 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Dt_AreaInfoController.cs" @@ -0,0 +1,20 @@ +锘縰sing Microsoft.AspNetCore.Mvc; +using WIDESEA_BusinessServices; +using WIDESEA_Core.BaseController; +using WIDESEA_IBusinessServices; +using WIDESEA_Model.Models; + +namespace WIDESEA_WMSServer.Controllers +{ + [Route("api/Dt_RoadWayInfo")] + [ApiController] + public class Dt_RoadWayInfoController : ApiBaseController<IDt_RoadWayInfoService, Dt_RoadWayInfo> + { + private readonly IHttpContextAccessor _httpContextAccessor; + public Dt_RoadWayInfoController(IDt_RoadWayInfoService service, IHttpContextAccessor httpContextAccessor) : base(service) + { + _httpContextAccessor = httpContextAccessor; + } + + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Dt_MaterielAttributeController.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Dt_MaterielAttributeController.cs" new file mode 100644 index 0000000..d040983 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Dt_MaterielAttributeController.cs" @@ -0,0 +1,20 @@ +锘縰sing Microsoft.AspNetCore.Mvc; +using WIDESEA_BusinessServices; +using WIDESEA_Core.BaseController; +using WIDESEA_IBusinessServices; +using WIDESEA_Model.Models; + +namespace WIDESEA_WMSServer.Controllers +{ + [Route("api/Dt_MaterielAttribute")] + [ApiController] + public class Dt_MaterielAttributeController : ApiBaseController<IDt_MaterielAttributeService, Dt_MaterielAttribute> + { + private readonly IHttpContextAccessor _httpContextAccessor; + public Dt_MaterielAttributeController(IDt_MaterielAttributeService service, IHttpContextAccessor httpContextAccessor) : base(service) + { + _httpContextAccessor = httpContextAccessor; + } + + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Dt_MaterielInfoController.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Dt_MaterielInfoController.cs" new file mode 100644 index 0000000..2dec7a2 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Dt_MaterielInfoController.cs" @@ -0,0 +1,19 @@ +锘縰sing Microsoft.AspNetCore.Mvc; +using WIDESEA_BusinessServices; +using WIDESEA_Core.BaseController; +using WIDESEA_IBusinessServices; +using WIDESEA_Model.Models; +namespace WIDESEA_WMSServer.Controllers +{ + [Route("api/Dt_MaterielInfo")] + [ApiController] + public class Dt_MaterielInfoController : ApiBaseController<IDt_MaterielInfoService, Dt_MaterielInfo> + { + private readonly IHttpContextAccessor _httpContextAccessor; + public Dt_MaterielInfoController(IDt_MaterielInfoService service, IHttpContextAccessor httpContextAccessor) : base(service) + { + _httpContextAccessor = httpContextAccessor; + } + + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Dt_RoadWayInfoController.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Dt_RoadWayInfoController.cs" new file mode 100644 index 0000000..674bd87 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Dt_RoadWayInfoController.cs" @@ -0,0 +1,20 @@ +锘縰sing Microsoft.AspNetCore.Mvc; +using WIDESEA_BusinessServices; +using WIDESEA_Core.BaseController; +using WIDESEA_IBusinessServices; +using WIDESEA_Model.Models; + +namespace WIDESEA_WMSServer.Controllers +{ + [Route("api/Dt_AreaInfo")] + [ApiController] + public class Dt_AreaInfoController : ApiBaseController<IDt_AreaInfoService, Dt_AreaInfo> + { + private readonly IHttpContextAccessor _httpContextAccessor; + public Dt_AreaInfoController(IDt_AreaInfoService service, IHttpContextAccessor httpContextAccessor) : base(service) + { + _httpContextAccessor = httpContextAccessor; + } + + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Dt_StrategyController.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Dt_StrategyController.cs" new file mode 100644 index 0000000..8508b90 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Dt_StrategyController.cs" @@ -0,0 +1,20 @@ +锘縰sing Microsoft.AspNetCore.Mvc; +using WIDESEA_BusinessServices; +using WIDESEA_Core.BaseController; +using WIDESEA_IBusinessServices; +using WIDESEA_Model.Models; + +namespace WIDESEA_WMSServer.Controllers +{ + [Route("api/Dt_Strategy")] + [ApiController] + public class Dt_StrategyController : ApiBaseController<IDt_StrategyService, Dt_Strategy> + { + private readonly IHttpContextAccessor _httpContextAccessor; + public Dt_StrategyController(IDt_StrategyService service, IHttpContextAccessor httpContextAccessor) : base(service) + { + _httpContextAccessor = httpContextAccessor; + } + + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Dt_UnitInfoController.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Dt_UnitInfoController.cs" new file mode 100644 index 0000000..2f6520f --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Dt_UnitInfoController.cs" @@ -0,0 +1,20 @@ +锘縰sing Microsoft.AspNetCore.Mvc; +using WIDESEA_BusinessServices; +using WIDESEA_Core.BaseController; +using WIDESEA_IBusinessServices; +using WIDESEA_Model.Models; + +namespace WIDESEA_WMSServer.Controllers +{ + [Route("api/Dt_UnitInfo")] + [ApiController] + public class Dt_UnitInfoController : ApiBaseController<IDt_UnitInfoService, Dt_UnitInfo> + { + private readonly IHttpContextAccessor _httpContextAccessor; + public Dt_UnitInfoController(IDt_UnitInfoService service, IHttpContextAccessor httpContextAccessor) : base(service) + { + _httpContextAccessor = httpContextAccessor; + } + + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Dt_WareAreaInfoController.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Dt_WareAreaInfoController.cs" new file mode 100644 index 0000000..aec787e --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Dt_WareAreaInfoController.cs" @@ -0,0 +1,20 @@ +锘縰sing Microsoft.AspNetCore.Mvc; +using WIDESEA_BusinessServices; +using WIDESEA_Core.BaseController; +using WIDESEA_IBusinessServices; +using WIDESEA_Model.Models; + +namespace WIDESEA_WMSServer.Controllers +{ + [Route("api/Dt_WareAreaInfo")] + [ApiController] + public class Dt_WareAreaInfoController : ApiBaseController<IDt_WareAreaInfoService, Dt_WareAreaInfo> + { + private readonly IHttpContextAccessor _httpContextAccessor; + public Dt_WareAreaInfoController(IDt_WareAreaInfoService service, IHttpContextAccessor httpContextAccessor) : base(service) + { + _httpContextAccessor = httpContextAccessor; + } + + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/MCS/MCSController.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/MCS/MCSController.cs" new file mode 100644 index 0000000..eee0b1a --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/MCS/MCSController.cs" @@ -0,0 +1,66 @@ +锘縰sing AutoMapper.Configuration.Annotations; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using WIDESEA_Core.BaseController; +using WIDESEA_DTO; +using WIDESEA_IStoragIntegrationServices; + +namespace WIDESEA_WMSServer.Controllers; + +[Route("api/[controller]")] +[ApiController] +public class MCSController : Controller +{ + private readonly IMCSService _MCSService; + private readonly IHttpContextAccessor _httpContextAccessor; + + public MCSController(IMCSService MCSService, IHttpContextAccessor httpContextAccessor) + { + _httpContextAccessor = httpContextAccessor; + _MCSService = MCSService; + } + + /// <summary> + /// 鍒嗗娴嬭瘯瀹屾垚閫氱煡 + /// </summary> + /// <param name="input"></param> + /// <returns></returns> + [HttpPost, Route("NotifyFinishTest"), AllowAnonymous] + public WebResponseContent NotifyFinishTest([FromBody] object input) + { + return _MCSService.NotifyFinishTest(input); + } + + /// <summary> + /// 璇锋眰绉诲簱 + /// </summary> + /// <param name="input"></param> + /// <returns></returns> + [HttpPost, Route("RequestChangeLocation"), AllowAnonymous] + public WebResponseContent RequestChangeLocation([FromBody] object input) + { + return _MCSService.RequestChangeLocation(input); + } + + /// <summary> + /// 鍒嗗搴撲綅鍚屾 + /// </summary> + /// <param name="input"></param> + /// <returns></returns> + [HttpPost, Route("ModifyAccessStatus"), AllowAnonymous] + public WebResponseContent ModifyAccessStatus([FromBody] object input) + { + return _MCSService.ModifyAccessStatus(input); + } + + /// <summary> + /// 鍒嗗鑾峰彇搴撲綅鎵樼洏 + /// </summary> + /// <param name="input"></param> + /// <returns></returns> + [HttpPost, Route("RequestCellInfo"), AllowAnonymous] + public object RequsetCellInfo([FromBody] object input) + { + return _MCSService.RequsetCellInfo(input); + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/OutboundOrder/Dt_OutOrderAndStockController.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/OutboundOrder/Dt_OutOrderAndStockController.cs" new file mode 100644 index 0000000..218cc31 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/OutboundOrder/Dt_OutOrderAndStockController.cs" @@ -0,0 +1,17 @@ +锘縰sing Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; + +namespace WIDESEA_WMSServer.Controllers.OutboundOrder +{ + [Route("api/[controller]")] + [ApiController] + public class Dt_OutOrderAndStockController : ApiBaseController<IDt_OutOrderAndStockService, Dt_OutOrderAndStock> + { + private readonly IHttpContextAccessor _httpContextAccessor; + + public Dt_OutOrderAndStockController(IDt_OutOrderAndStockService service, IHttpContextAccessor httpContextAccessor) : base(service) + { + _httpContextAccessor = httpContextAccessor; + } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/OutboundOrder/Dt_OutOrderAndStock_HtyController.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/OutboundOrder/Dt_OutOrderAndStock_HtyController.cs" new file mode 100644 index 0000000..9041aec --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/OutboundOrder/Dt_OutOrderAndStock_HtyController.cs" @@ -0,0 +1,17 @@ +锘縰sing Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; + +namespace WIDESEA_WMSServer.Controllers +{ + [Route("api/[controller]")] + [ApiController] + public class Dt_OutOrderAndStock_HtyController : ApiBaseController<IDt_OutOrderAndStock_HtyService, Dt_OutOrderAndStock_Hty> + { + private readonly IHttpContextAccessor _httpContextAccessor; + + public Dt_OutOrderAndStock_HtyController(IDt_OutOrderAndStock_HtyService service, IHttpContextAccessor httpContextAccessor) : base(service) + { + _httpContextAccessor = httpContextAccessor; + } + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/OutboundOrder/Dt_OutOrderController.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/OutboundOrder/Dt_OutOrderController.cs" new file mode 100644 index 0000000..7fa1823 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/OutboundOrder/Dt_OutOrderController.cs" @@ -0,0 +1,49 @@ +锘縩amespace WIDESEA_WMSServer.Controllers; + +/// <summary> +/// 绯荤粺璁㈠崟鎺ュ彛 +/// </summary> +[Route("api/[controller]")] +[ApiController] +public class Dt_OutOrderController : ApiBaseController<IDt_OutOrderService, Dt_OutOrder> +{ + private readonly IHttpContextAccessor _httpContextAccessor; + + public Dt_OutOrderController(IDt_OutOrderService service, IHttpContextAccessor httpContextAccessor) : base(service) + { + _httpContextAccessor = httpContextAccessor; + } + + /// <summary> + /// 娣诲姞鐢熶骇鍑哄簱鍗� + /// </summary> + /// <param name="saveModel">鍑哄簱鏁版嵁</param> + /// <returns>鎴愬姛鎴栧け璐�</returns> + [HttpPost, Route("AddOutOrderProduction"), AllowAnonymous] + public WebResponseContent AddOutOrderProduction([FromBody] SaveModel saveModel) + { + return Service.AddOutOrderProduction(saveModel); + } + + /// <summary> + /// 娣诲姞璋冩嫧鍑哄簱鍗� + /// </summary> + /// <param name="saveModel">鍑哄簱鏁版嵁</param> + /// <returns>鎴愬姛鎴栧け璐�</returns> + [HttpPost, Route("AddOutOrderTransfer"), AllowAnonymous] + public WebResponseContent AddOutOrderTransfer([FromBody] SaveModel saveModel) + { + return Service.AddOutOrderTransfer(saveModel); + } + + /// <summary> + /// 鏍规嵁鍑哄簱璁㈠崟鑾峰彇鍑哄簱搴撳瓨 + /// </summary> + /// <param name="orderNo">鍑哄簱鏁版嵁</param> + /// <returns>鎴愬姛鎴栧け璐�</returns> + [HttpPost, HttpGet, Route("GetOutboundStockAsync"), AllowAnonymous] + public async Task<WebResponseContent> GetOutboundStockAsync(string orderNo) + { + return await Service.GetOutboundStockAsync(orderNo); + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/OutboundOrder/Dt_OutOrderDetailController.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/OutboundOrder/Dt_OutOrderDetailController.cs" new file mode 100644 index 0000000..1c2647a --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/OutboundOrder/Dt_OutOrderDetailController.cs" @@ -0,0 +1,18 @@ +锘縰sing Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using WIDESEA_StorageOutOrderServices; + +namespace WIDESEA_WMSServer.Controllers +{ + [Route("api/[controller]")] + [ApiController] + public class Dt_OutOrderDetailController: ApiBaseController<IDt_OutOrderDtailService, Dt_OutOrderDetail> + { + private readonly IHttpContextAccessor _httpContextAccessor; + + public Dt_OutOrderDetailController(IDt_OutOrderDtailService service, IHttpContextAccessor httpContextAccessor) : base(service) + { + _httpContextAccessor = httpContextAccessor; + } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/OutboundOrder/Dt_OutOrderProductionController.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/OutboundOrder/Dt_OutOrderProductionController.cs" new file mode 100644 index 0000000..993fbb3 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/OutboundOrder/Dt_OutOrderProductionController.cs" @@ -0,0 +1,17 @@ +锘縰sing Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; + +namespace WIDESEA_WMSServer.Controllers +{ + [Route("api/[controller]")] + [ApiController] + public class Dt_OutOrderProductionController : ApiBaseController<IDt_OutOrderProductionService, Dt_OutOrderProduction> + { + private readonly IHttpContextAccessor _httpContextAccessor; + + public Dt_OutOrderProductionController(IDt_OutOrderProductionService service, IHttpContextAccessor httpContextAccessor) : base(service) + { + _httpContextAccessor = httpContextAccessor; + } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/OutboundOrder/Dt_OutOrderProductionDetailController.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/OutboundOrder/Dt_OutOrderProductionDetailController.cs" new file mode 100644 index 0000000..a47d51a --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/OutboundOrder/Dt_OutOrderProductionDetailController.cs" @@ -0,0 +1,17 @@ +锘縰sing Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; + +namespace WIDESEA_WMSServer.Controllers.OutboundOrder +{ + [Route("api/[controller]")] + [ApiController] + public class Dt_OutOrderProductionDetailController : ApiBaseController<IDt_OutOrderProductionDetailService, Dt_OutOrderProductionDetail> + { + private readonly IHttpContextAccessor _httpContextAccessor; + + public Dt_OutOrderProductionDetailController(IDt_OutOrderProductionDetailService service, IHttpContextAccessor httpContextAccessor) : base(service) + { + _httpContextAccessor = httpContextAccessor; + } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/OutboundOrder/Dt_OutOrderTransferController.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/OutboundOrder/Dt_OutOrderTransferController.cs" new file mode 100644 index 0000000..73293fa --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/OutboundOrder/Dt_OutOrderTransferController.cs" @@ -0,0 +1,17 @@ +锘縰sing Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; + +namespace WIDESEA_WMSServer.Controllers.OutboundOrder +{ + [Route("api/[controller]")] + [ApiController] + public class Dt_OutOrderTransferController : ApiBaseController<IDt_OutOrderTransferService, Dt_OutOrderTransfer> + { + private readonly IHttpContextAccessor _httpContextAccessor; + + public Dt_OutOrderTransferController(IDt_OutOrderTransferService service, IHttpContextAccessor httpContextAccessor) : base(service) + { + _httpContextAccessor = httpContextAccessor; + } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/OutboundOrder/Dt_OutOrderTransferDetailController.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/OutboundOrder/Dt_OutOrderTransferDetailController.cs" new file mode 100644 index 0000000..fcd950e --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/OutboundOrder/Dt_OutOrderTransferDetailController.cs" @@ -0,0 +1,17 @@ +锘縰sing Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; + +namespace WIDESEA_WMSServer.Controllers.OutboundOrder +{ + [Route("api/[controller]")] + [ApiController] + public class Dt_OutOrderTransferDetailController : ApiBaseController<IDt_OutOrderTransferDetailService, Dt_OutOrderTransferDetail> + { + private readonly IHttpContextAccessor _httpContextAccessor; + + public Dt_OutOrderTransferDetailController(IDt_OutOrderTransferDetailService service, IHttpContextAccessor httpContextAccessor) : base(service) + { + _httpContextAccessor = httpContextAccessor; + } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Stock/Dt_WheelsStockController.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Stock/Dt_WheelsStockController.cs" new file mode 100644 index 0000000..df60da5 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Stock/Dt_WheelsStockController.cs" @@ -0,0 +1,13 @@ +锘縰sing WIDESEA_IStorageBasicService; + +namespace WIDESEA_WMSServer.Controllers; + +[Route("api/Dt_WheelsStock")] +[ApiController] +public class Dt_WheelsStockController : ApiBaseController<IDt_WheelsStockService, Dt_WheelsStock> +{ + public Dt_WheelsStockController(IDt_WheelsStockService service) : base(service) + { + + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Stock/Dt_WheelsStock_OldController.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Stock/Dt_WheelsStock_OldController.cs" new file mode 100644 index 0000000..c1623c6 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Stock/Dt_WheelsStock_OldController.cs" @@ -0,0 +1,26 @@ +锘縰sing WIDESEA_IStorageBasicService; +using WIDESEA_StorageBasicService; + +namespace WIDESEA_WMSServer.Controllers; + +[Route("api/Dt_WheelsStock_Old")] +[ApiController] +public class Dt_WheelsStock_OldController : ApiBaseController<IDt_WheelsStock_OldService, Dt_WheelsStock_Old> +{ + private readonly IDt_WheelsStock_OldService _WheelsStock_OldService; + public Dt_WheelsStock_OldController(IDt_WheelsStock_OldService service) : base(service) + { + _WheelsStock_OldService = service; + } + + /// <summary> + /// 鑾峰彇鏃у簱鏁版嵁 + /// </summary> + /// <param name="id"></param> + /// <returns></returns> + [HttpGet, Route("GetOldLocationWheels"), AllowAnonymous] + public WebResponseContent GetOldLocationWheels() + { + return _WheelsStock_OldService.GetOldLocationWheels(); + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Stock/Dt_WheelsStock_htyController.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Stock/Dt_WheelsStock_htyController.cs" new file mode 100644 index 0000000..68b8c4c --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Stock/Dt_WheelsStock_htyController.cs" @@ -0,0 +1,13 @@ +锘縰sing WIDESEA_IStorageBasicService; +using WIDESEA_StorageBasicService; + +namespace WIDESEA_WMSServer.Controllers; + +[Route("api/Dt_WheelsStock_hty")] +[ApiController] +public class Dt_WheelsStock_htyController : ApiBaseController<IDt_WheelsStock_htyService, Dt_WheelsStock_hty> +{ + public Dt_WheelsStock_htyController(IDt_WheelsStock_htyService service) : base(service) + { + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/System/Sys_ConfigController.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/System/Sys_ConfigController.cs" new file mode 100644 index 0000000..46a1dbf --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/System/Sys_ConfigController.cs" @@ -0,0 +1,18 @@ +锘縰sing Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; + +namespace WIDESEA_WMSServer.Controllers; + +[Route("api/[controller]")] +[ApiController] +public class Sys_ConfigController : ApiBaseController<ISys_ConfigService, Sys_Config> +{ + private readonly IHttpContextAccessor _httpContextAccessor; + + public Sys_ConfigController(ISys_ConfigService menuService, IHttpContextAccessor httpContextAccessor) : base(menuService) + { + _httpContextAccessor = httpContextAccessor; + } + + +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/System/Sys_DictionaryController.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/System/Sys_DictionaryController.cs" new file mode 100644 index 0000000..78815e1 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/System/Sys_DictionaryController.cs" @@ -0,0 +1,19 @@ +锘縩amespace WIDESEA_WMSServer.Controllers; + +[Route("api/Sys_Dictionary")] +[ApiController] +public class Sys_DictionaryController : ApiBaseController<ISys_DictionaryService, Sys_Dictionary> +{ + private readonly IHttpContextAccessor _httpContextAccessor; + + public Sys_DictionaryController(ISys_DictionaryService service, IHttpContextAccessor httpContextAccessor) : base(service) + { + _httpContextAccessor = httpContextAccessor; + } + + [HttpPost, Route("GetVueDictionary"), AllowAnonymous] + public IActionResult GetVueDictionary([FromBody] string[] dicNos) + { + return Content(Service.GetVueDictionary(dicNos).Serialize()); + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/System/Sys_MenuController.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/System/Sys_MenuController.cs" new file mode 100644 index 0000000..4fc0b75 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/System/Sys_MenuController.cs" @@ -0,0 +1,50 @@ +锘縩amespace WIDESEA_WMSServer.Controllers; + +[Route("api/Menu")] +[ApiController] +public class Sys_MenuController : ApiBaseController<ISys_MenuService, Sys_Menu> +{ + private readonly IHttpContextAccessor _httpContextAccessor; + + public Sys_MenuController(ISys_MenuService menuService, IHttpContextAccessor httpContextAccessor) : base(menuService) + { + _httpContextAccessor = httpContextAccessor; + } + + [HttpGet, HttpPost, Route("getTreeMenu")] + public IActionResult GetTreeMenu() + { + return Json(Service.GetCurrentMenuActionList()); + } + + [HttpGet, HttpPost, Route("getTreePhoneMenu")] + public IActionResult GetTreePhoneMenu() + { + return Json(Service.GetCurrentMenuPhoneActionList()); + } + + [HttpPost, Route("getMenu")] + public IActionResult GetMenu() + { + return Json(Service.GetMenu()); + } + + [HttpPost, Route("getTreeItem")] + public async Task<IActionResult> GetTreeItem(int menuId) + { + return Json(Service.GetTreeItem(menuId)); + } + + [HttpPost, Route("save")] + public ActionResult Save([FromBody] Sys_Menu menu) + { + if (App.User.IsSuperAdmin) + { + return Json(Service.Save(menu)); + } + else + { + return Json(WebResponseContent.Instance.Error("浠呴檺瓒呯骇绠$悊鍛樹慨鏀规暟鎹�")); + } + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/System/Sys_RegistrationController.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/System/Sys_RegistrationController.cs" new file mode 100644 index 0000000..b6bc0b4 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/System/Sys_RegistrationController.cs" @@ -0,0 +1,26 @@ +锘縰sing Autofac.Builder; + +namespace WIDESEA_WMSServer.Controllers; + +[Route("api/[controller]")] +[ApiController] +public class Sys_RegistrationController : ApiBaseController<ISys_CompanyRegistrationService, Sys_User> +{ + private readonly IHttpContextAccessor _httpContextAccessor; + + public Sys_RegistrationController(ISys_CompanyRegistrationService userService, IHttpContextAccessor httpContextAccessor) : base(userService) + { + _httpContextAccessor = httpContextAccessor; + } + + /// <summary> + /// 娣诲姞鐢熶骇鍑哄簱鍗� + /// </summary> + /// <param name="saveModel">鍑哄簱鏁版嵁</param> + /// <returns>鎴愬姛鎴栧け璐�</returns> + [HttpPost, Route("RegisterCompany"), AllowAnonymous] + public WebResponseContent RegisterCompany([FromBody] RegistrationDTO saveModel) + { + return Service.RegisterCompany(saveModel); + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/System/Sys_RoleController.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/System/Sys_RoleController.cs" new file mode 100644 index 0000000..28ca857 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/System/Sys_RoleController.cs" @@ -0,0 +1,64 @@ +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Routing; +using WIDESEA_Core; +using WIDESEA_Core.BaseController; +using WIDESEA_Core.BaseRepository; +using WIDESEA_DTO.System; +using WIDESEA_IServices; +using WIDESEA_Model.Models; +using WIDESEA_Model.Models.System; +namespace WIDESEA_WMSServer.Controllers{ + +[Route("api/Sys_Role")] +[ApiController] +public class Sys_RoleController : ApiBaseController<ISys_RoleService, Sys_Role> +{ + private readonly IHttpContextAccessor _httpContextAccessor; + + public Sys_RoleController(ISys_RoleService service, IHttpContextAccessor httpContextAccessor) : base(service) + { + _httpContextAccessor = httpContextAccessor; + } + + [HttpPost, Route("getUserChildRoles")] + public IActionResult GetUserChildRoles() + { + int roleId = App.User.RoleId; + var data = Service.GetAllChildren(roleId); + + if (App.User.IsSuperAdmin) + { + return Json(WebResponseContent.Instance.OK(null, data)); + } + //涓嶆槸瓒呯骇绠$悊锛屽皢鑷繁鐨勮鑹叉煡鍑烘潵锛屽湪鏍戝舰鑿滃崟涓婁綔涓烘牴鑺傜偣 + var self = data.Where(x => x.Id == roleId) + .Select(s => new RoleNodes() + { + Id = s.Id, + ParentId = 0,//灏嗚嚜宸辩殑瑙掕壊浣滀负root鑺傜偣 + RoleName = s.RoleName + }).ToList(); + data.AddRange(self); + return Json(WebResponseContent.Instance.OK(null, data)); + } + + [HttpPost, Route("getCurrentTreePermission")] + public IActionResult GetCurrentTreePermission() + { + return Json(Service.GetCurrentTreePermission()); + } + + [HttpPost, Route("getUserTreePermission")] + public IActionResult GetUserTreePermission(int roleId) + { + return Json(Service.GetUserTreePermission(roleId)); + } + + [HttpPost, Route("savePermission")] + public IActionResult SavePermission([FromBody] List<UserPermissionDTO> userPermissions, int roleId) + { + return Json(Service.SavePermission(userPermissions, roleId)); + } +} +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/System/Sys_TenantController.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/System/Sys_TenantController.cs" new file mode 100644 index 0000000..ed0a678 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/System/Sys_TenantController.cs" @@ -0,0 +1,19 @@ +锘縩amespace WIDESEA_WMSServer.Controllers; + +[Route("api/tenant")] +[ApiController] +public class Sys_TenantController : ApiBaseController<ISys_TenantService, Sys_Tenant> +{ + private readonly IHttpContextAccessor _httpContextAccessor; + + public Sys_TenantController(ISys_TenantService tenantService, IHttpContextAccessor httpContextAccessor) : base(tenantService) + { + _httpContextAccessor = httpContextAccessor; + } + + [HttpGet, Route("initTenantInfo"), AllowAnonymous] + public WebResponseContent InitTenantInfo(string tenantName, int tenantType) + { + return Service.InitTenantInfo(tenantName, tenantType); + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/System/Sys_TestController.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/System/Sys_TestController.cs" new file mode 100644 index 0000000..7af7e7a --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/System/Sys_TestController.cs" @@ -0,0 +1,19 @@ +锘縩amespace WIDESEA_WMSServer.Controllers; + +[Route("api/test")] +[ApiController] +public class Sys_TestController : ApiBaseController<ISys_TestService, Sys_Test> +{ + private readonly IHttpContextAccessor _httpContextAccessor; + + public Sys_TestController(ISys_TestService service, IHttpContextAccessor httpContextAccessor) : base(service) + { + _httpContextAccessor = httpContextAccessor; + } + + [HttpGet, Route("TranTest"), AllowAnonymous] + public WebResponseContent TranTest() + { + return Service.TranTest(); + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/System/Sys_UserController.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/System/Sys_UserController.cs" new file mode 100644 index 0000000..a91e2d9 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/System/Sys_UserController.cs" @@ -0,0 +1,68 @@ +锘縰sing WIDESEA_Core.Helper; +using WIDESEA_IRepository; +using WIDESEA_Repository; + +namespace WIDESEA_WMSServer.Controllers; + +[Route("api/Sys_User")] +[ApiController] +public class Sys_UserController : ApiBaseController<ISys_UserService, Sys_User> +{ + private readonly IHttpContextAccessor _httpContextAccessor; + + public Sys_UserController(ISys_UserService userService, IHttpContextAccessor httpContextAccessor) : base(userService) + { + _httpContextAccessor = httpContextAccessor; + } + + [HttpPost, Route("login"), AllowAnonymous] + public IActionResult Login([FromBody] LoginInfo loginInfo) + { + return Json(Service.Login(loginInfo)); + } + + [HttpPost, Route("getCurrentUserInfo")] + public WebResponseContent GetCurrentUser() + { + return Service.GetCurrentUserInfo(); + } + + [HttpPost, Route("modifyPwd")] + public IActionResult ModifyPwd(string oldPwd, string newPwd) + { + return Json(Service.ModifyPwd(oldPwd, newPwd)); + } + + //鍙兘瓒呯骇绠$悊鍛樻墠鑳戒慨鏀瑰瘑鐮� + //2020.08.01澧炲姞淇敼瀵嗙爜鍔熻兘 + [HttpPost, Route("modifyUserPwd")] + public IActionResult ModifyUserPwd(string password, string userName) + { + return Json(Service.ModifyUserPwd(password, userName)); + } + [HttpPost, Route("UpdateInfo")] + public IActionResult UpdateInfo(int user_Id, string roleName, string userName, string userTrueName, string address, int gender, string remark) + { + return Json(Service.UpdateInfo(user_Id, roleName, userName, userTrueName, address, gender, remark)); + } + + [HttpGet, Route("getVierificationCode"), AllowAnonymous] + public IActionResult GetVierificationCode() + { + //var html = MiniProfiler.Current.RenderIncludes(_httpContextAccessor.HttpContext); + string code = "1234" /*VierificationCode.RandomText()*/; + var data = new + { + img = VierificationCode.CreateBase64Imgage(code), + uuid = Guid.NewGuid() + }; + + return Json(data); + } + + [HttpGet, Route("SerializeJwt"), AllowAnonymous] + public WebResponseContent SerializeJwt(string code) + { + return WebResponseContent.Instance.OK(data: JwtHelper.SerializeJwt(code)); + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/TaskController.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/TaskController.cs" new file mode 100644 index 0000000..3583d5a --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/TaskController.cs" @@ -0,0 +1,125 @@ +锘縰sing WIDESEA_DTO; +using static WIDESEA_DTO.RequestTaskDto; + +namespace WIDESEA_WMSServer.Controllers; + +/// <summary> +/// 浠诲姟鎿嶄綔鎺ュ彛 +/// </summary> +[Route("api/[controller]")] +[ApiController] +public class TaskController : ApiBaseController<IDt_TaskService, Dt_Task> +{ + private readonly IHttpContextAccessor _httpContextAccessor; + private readonly IDt_TaskService _taskService; + private readonly ILocationInfoService _locationService; + + public TaskController(IDt_TaskService taskService, + IHttpContextAccessor httpContextAccessor, + ILocationInfoService locationService) : base(taskService) + { + _httpContextAccessor = httpContextAccessor; + _taskService = taskService; + _locationService = locationService; + } + + /// <summary> + /// 浠诲姟瀹屾垚 + /// </summary> + /// <param name="saveModel">浠诲姟鍙�</param> + /// <returns>鎴愬姛鎴栧け璐�</returns> + [HttpGet, Route("CompleteTaskAsync"), AllowAnonymous] + public async Task<WebResponseContent> CompleteTaskAsync(int taskNum) + { + return await _taskService.CompleteAsync(taskNum); + } + + /// <summary> + /// 浠诲姟瀹屾垚 + /// </summary> + /// <param name="saveModel">浠诲姟鍙�</param> + /// <returns>鎴愬姛鎴栧け璐�</returns> + //[HttpGet, Route("CompleteTaskByStation"), AllowAnonymous] + //public async Task<WebResponseContent> CompleteTaskByStation(int taskNum) + //{ + // return await _taskService.CompleteTaskByStation(taskNum); + //} + + /// <summary> + /// 妫�鏌ユ槸鍚﹂渶瑕佽繘琛岀Щ搴� + /// </summary> + /// <param name="taskNum">浠诲姟鍙�</param> + /// <returns>浠诲姟</returns> + [HttpPost, Route("TransferCheckAsync"), AllowAnonymous] + public async Task<WebResponseContent> TransferCheckAsync([FromBody] RequestTaskDto input) + { + return new WebResponseContent().OK(data: await _locationService.TransferCheckAsync(input)); + } + + + /// <summary> + /// 璇锋眰浠诲姟宸烽亾 + /// </summary> + /// <param name="input">璇锋眰鏁版嵁</param> + /// <returns></returns> + [HttpPost, AllowAnonymous, Route("RequestInTask")] + public async Task<WebResponseContent> RequestInTask([FromBody] RequestTaskDto input) + { + return await Service.RequestInTask(input); + } + + /// <summary> + /// 璇锋眰浠诲姟璐т綅 + /// </summary> + /// <param name="input">璇锋眰鏁版嵁</param> + /// <returns></returns> + [HttpPost, AllowAnonymous, Route("RequestLocationTaskAsync")] + public async Task<WebResponseContent> UpdateExistingTask([FromBody] RequestTaskDto input) + { + return await Service.UpdateExistingTask(input); + } + + /// <summary> + /// 浠诲姟鐘舵�佷慨鏀� + /// </summary> + /// <param name="input">璇锋眰鏁版嵁</param> + /// <returns></returns> + [HttpPost, AllowAnonymous, Route("UpdateTaskStatus")] + public async Task<WebResponseContent> UpdateTaskStatus([FromBody] UpdateStatusDto input) + { + return await Service.UpdateTaskStatus(input.TaskNum, input.TaskState); + } + + /// <summary> + /// 浠诲姟鐘舵�佷慨鏀� + /// </summary> + /// <param name="input">璇锋眰鏁版嵁</param> + /// <returns></returns> + [HttpPost, AllowAnonymous, Route("UpdateCheckTask")] + public async Task<WebResponseContent> UpdateCheckTask([FromBody] RequestTaskDto input) + { + return await Service.UpdateCheckTask(input); + } + + /// <summary> + /// 娴佸悜鍒嗛厤 + /// </summary> + /// <param name="input">璇锋眰鏁版嵁</param> + /// <returns></returns> + [HttpPost, AllowAnonymous, Route("RequestWheelsFlow")] + public async Task<WebResponseContent> RequestWheelsFlow([FromBody] RequestTaskDto input) + { + return await Service.RequestWheelsFlow(input); + } + + /// <summary> + /// 鍒涘缓鎸囧畾浠诲姟 + /// </summary> + /// <param name="palletCode">鎵樼洏鍙�</param> + /// <returns></returns> + [HttpPost, AllowAnonymous, Route("CreateAndSendOutboundTask")] + public WebResponseContent CreateAndSendOutboundTask([FromBody] SaveModel saveModel) //string palletCode, string station + { + return Service.CreateAndSendOutboundTask(saveModel); + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/TaskExecuteDetailController.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/TaskExecuteDetailController.cs" new file mode 100644 index 0000000..ec885d4 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/TaskExecuteDetailController.cs" @@ -0,0 +1,20 @@ +锘縰sing Microsoft.AspNetCore.Mvc; +using WIDESEA_BusinessServices; +using WIDESEA_Core.BaseController; +using WIDESEA_IBusinessServices; +using WIDESEA_Model.Models; + +namespace WIDESEA_WMSServer.Controllers +{ + [Route("api/[controller]")] + [ApiController] + public class TaskExecuteDetailController : ApiBaseController<IDt_TaskExecuteDetailService, Dt_TaskExecuteDetail> + { + private readonly IHttpContextAccessor _httpContextAccessor; + + public TaskExecuteDetailController(IDt_TaskExecuteDetailService service, IHttpContextAccessor httpContextAccessor) : base(service) + { + _httpContextAccessor = httpContextAccessor; + } + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Task_HtyController.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Task_HtyController.cs" new file mode 100644 index 0000000..f09779a --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Task_HtyController.cs" @@ -0,0 +1,26 @@ +锘縰sing WIDESEA_DTO; +using static WIDESEA_DTO.RequestTaskDto; + +namespace WIDESEA_WMSServer.Controllers; + +/// <summary> +/// 浠诲姟鎿嶄綔鎺ュ彛 +/// </summary> +[Route("api/[controller]")] +[ApiController] +public class Task_HtyController : ApiBaseController<IDt_Task_HtyService, Dt_Task_Hty> +{ + private readonly IHttpContextAccessor _httpContextAccessor; + private readonly IDt_Task_HtyService _task_HtyService; + private readonly ILocationInfoService _locationService; + + public Task_HtyController(IDt_Task_HtyService task_HtyService, + IHttpContextAccessor httpContextAccessor, + ILocationInfoService locationService) : base(task_HtyService) + { + _httpContextAccessor = httpContextAccessor; + _task_HtyService = task_HtyService; + _locationService = locationService; + } + +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/WCS/WCSController.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/WCS/WCSController.cs" new file mode 100644 index 0000000..dc9483e --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/WCS/WCSController.cs" @@ -0,0 +1,24 @@ +锘縰sing AutoMapper.Configuration.Annotations; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using WIDESEA_Core.BaseController; +using WIDESEA_DTO; +using WIDESEA_IStoragIntegrationServices; + +namespace WIDESEA_WMSServer.Controllers; + +[Route("api/[controller]")] +[ApiController] +public class WCSController : Controller +{ + private readonly IWCSService _WCSService; + private readonly IHttpContextAccessor _httpContextAccessor; + + public WCSController(IWCSService WCSService, IHttpContextAccessor httpContextAccessor) + { + _httpContextAccessor = httpContextAccessor; + _WCSService = WCSService; + } + + +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/ZY/ToZYController.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/ZY/ToZYController.cs" new file mode 100644 index 0000000..28d95e8 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/ZY/ToZYController.cs" @@ -0,0 +1,57 @@ +锘縰sing AutoMapper.Configuration.Annotations; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using WIDESEA_Common; +using WIDESEA_Core.BaseController; +using WIDESEA_DTO; +using WIDESEA_IStoragIntegrationServices; + +namespace WIDESEA_WMSServer.Controllers; + +[Route("api/[controller]")] +[ApiController] +public class ToZYController : Controller +{ + private readonly IToZYService _ZYService; + private readonly IHttpContextAccessor _httpContextAccessor; + + public ToZYController(IToZYService ZYService, IHttpContextAccessor httpContextAccessor) + { + _httpContextAccessor = httpContextAccessor; + _ZYService = ZYService; + } + + + /// <summary> + /// 鑾峰彇杞﹁疆淇℃伅 + /// </summary> + /// <param name="input"></param> + /// <returns></returns> + [HttpPost, Route("ZY_GetCLInfo"), AllowAnonymous] + public object RequsetCellInfo([FromBody] SaveModel input) + { + return _ZYService.ZY_GetCLInfo(input); + } + + /// <summary> + /// 鑾峰彇鍒跺姩鐩樹俊鎭� + /// </summary> + /// <param name="input"></param> + /// <returns></returns> + [HttpPost, Route("getZDPInfo"), AllowAnonymous] + public object getZDPInfo([FromBody] SaveModel input) + { + return _ZYService.getZDPInfo(input); + } + + /// <summary> + /// 鑾峰彇鍒跺姩鐩樹俊鎭� + /// </summary> + /// <param name="input"></param> + /// <returns></returns> + [HttpPost, Route("getCZInfo"), AllowAnonymous] + public object getCZInfo([FromBody] SaveModel input) + { + return _ZYService.getCZInfo(input); + } +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Filter/AutoMapperConfig.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Filter/AutoMapperConfig.cs" new file mode 100644 index 0000000..2892fb3 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Filter/AutoMapperConfig.cs" @@ -0,0 +1,18 @@ +锘縰sing AutoMapper; + +namespace WIDESEA_WMSServer.Filter +{ + /// <summary> + /// 闈欐�佸叏灞� AutoMapper 閰嶇疆鏂囦欢 + /// </summary> + public class AutoMapperConfig + { + public static MapperConfiguration RegisterMappings() + { + return new MapperConfiguration(cfg => + { + cfg.AddProfile(new CustomProfile()); + }); + } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Filter/AutoMapperSetup.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Filter/AutoMapperSetup.cs" new file mode 100644 index 0000000..0e51421 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Filter/AutoMapperSetup.cs" @@ -0,0 +1,16 @@ +锘縩amespace WIDESEA_WMSServer.Filter +{ + /// <summary> + /// Automapper 鍚姩鏈嶅姟 + /// </summary> + public static class AutoMapperSetup + { + public static void AddAutoMapperSetup(this IServiceCollection services) + { + if (services == null) throw new ArgumentNullException(nameof(services)); + + services.AddAutoMapper(typeof(AutoMapperConfig)); + AutoMapperConfig.RegisterMappings(); + } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Filter/AutofacPropertityModuleReg.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Filter/AutofacPropertityModuleReg.cs" new file mode 100644 index 0000000..f10530b --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Filter/AutofacPropertityModuleReg.cs" @@ -0,0 +1,17 @@ +锘縰sing Autofac; +using Microsoft.AspNetCore.Mvc; + +namespace WIDESEA_WMSServer.Filter +{ + public class AutofacPropertityModuleReg : Autofac.Module + { + protected override void Load(ContainerBuilder builder) + { + var controllerBaseType = typeof(ControllerBase); + builder.RegisterAssemblyTypes(typeof(Program).Assembly) + .Where(t => controllerBaseType.IsAssignableFrom(t) && t != controllerBaseType) + .PropertiesAutowired(); + + } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Filter/CustomProfile.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Filter/CustomProfile.cs" new file mode 100644 index 0000000..c3d1570 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Filter/CustomProfile.cs" @@ -0,0 +1,26 @@ +锘縰sing Autofac.Builder; +using AutoMapper; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_DTO.System; +using WIDESEA_Model.Models; + +namespace WIDESEA_WMSServer.Filter +{ + public class CustomProfile : Profile + { + /// <summary> + /// 閰嶇疆鏋勯�犲嚱鏁帮紝鐢ㄦ潵鍒涘缓鍏崇郴鏄犲皠 + /// </summary> + public CustomProfile() + { + CreateMap<Sys_Menu, MenuDTO>(); + CreateMap<RegistrationDTO, Sys_CompanyRegistration>(); + CreateMap<Dt_OutOrderAndStock, Dt_OutOrderAndStock_Hty>(); + CreateMap<Dt_Task, Dt_Task_Hty>(); + } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/GlobalUsing.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/GlobalUsing.cs" new file mode 100644 index 0000000..9fd4dd7 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/GlobalUsing.cs" @@ -0,0 +1,16 @@ +锘縢lobal using WIDESEA_Core.BaseController; +global using WIDESEA_Model.Models; +global using Microsoft.AspNetCore.Mvc; +global using Microsoft.AspNetCore.Authorization; +global using WIDESEA_Core; +global using WIDESEA_IStorageOutOrderServices; +global using WIDESEA_IStorageBasicService; +global using WIDESEA_IStorageTaskServices; +global using WIDESEA_Core.Helper; +global using WIDESEA_IServices; +global using WIDESEA_DTO.System; +global using WIDESEA_Model.Models.System; +global using WIDESEA_Core.Authorization; +global using WIDESEA_Core.Utilities; +global using WIDESEA_Model; +//global using WIDESEA_StorageBasicServices; \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Properties/launchSettings.json" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Properties/launchSettings.json" new file mode 100644 index 0000000..16b63a2 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Properties/launchSettings.json" @@ -0,0 +1,31 @@ +锘縶 + "$schema": "https://json.schemastore.org/launchsettings.json", + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:39740", + "sslPort": 0 + } + }, + "profiles": { + "WIDESEA_WMSServer": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + //"launchUrl": "swagger", + "applicationUrl": "http://localhost:5230", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + //"launchUrl": "swagger", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/appsettings.Development.json" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/appsettings.Development.json" new file mode 100644 index 0000000..0c208ae --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/appsettings.Development.json" @@ -0,0 +1,8 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + } +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/appsettings.json" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/appsettings.json" new file mode 100644 index 0000000..2270a05 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/appsettings.json" @@ -0,0 +1,41 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + }, + "AllowedHosts": "*", + "urls": "http://*:5000", + "MainDB": "DB_WIDESEA", //褰撳墠椤圭洰鐨勪富搴擄紝鎵�瀵瑰簲鐨勮繛鎺ュ瓧绗︿覆鐨凟nabled蹇呴』涓簍rue + //杩炴帴瀛楃涓� + //"ConnectionString": "HTI6FB1H05Krd07mNm9yBCNhofW6edA5zLs9TY~MNthRYW3kn0qKbMIsGp~3yyPDF1YZUCPBQx8U0Jfk4PH~ajNFXVIwlH85M3F~v_qKYQ3CeAz3q1mLVDn8O5uWt1~3Ut2V3KRkEwYHvW2oMDN~QIDXPxDgXN0R2oTIhc9dNu7QNaLEknblqmHhjaNSSpERdDVZIgHnMKejU_SL49tralBkZmDNi0hmkbL~837j1NWe37u9fJKmv91QPb~16JsuI9uu0EvNZ06g6PuZfOSAeFH9GMMIZiketdcJG3tHelo=", + //"ConnectionString": "Data Source=192.168.5.251;Initial Catalog=WIDESEA_WMSDB_BBMain;User ID=sa;Password=P@ssw0rd;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False", + "ConnectionString": "Data Source=.\\LIULEI;Initial Catalog=MX_LDY_WMS;User ID=sa;Password=123456;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False", + //"ConnectionString": "Data Source=.\\LIULEI;Initial Catalog=WIDESEA_WMSDB_BBMain;User ID=sa;Password=123456;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False", + //"ConnectionString": "Data Source=192.168.20.251;Initial Catalog=WIDESEA_WMSDB;User ID=sa;Password=123456@gy;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False", + //"ConnectionStringWCS": "Data Source=192.168.5.251;Initial Catalog=WIDESEAWCS_TEST;User ID=sa;Password=P@ssw0rd;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False", + "ConnectionStringWCS": "Data Source=.\\LIULEI;Initial Catalog=MX_LDY_WCS;User ID=sa;Password=123456;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False", + //璺ㄥ煙 + "Cors": { + "PolicyName": "CorsIpAccess", //绛栫暐鍚嶇О + "EnableAllIPs": true, //褰撲负true鏃讹紝寮�鏀炬墍鏈塈P鍧囧彲璁块棶銆� + // 鏀寔澶氫釜鍩熷悕绔彛锛屾敞鎰忕鍙e彿鍚庝笉瑕佸甫/鏂滄潌锛氭瘮濡俵ocalhost:8000/锛屾槸閿欑殑 + // 娉ㄦ剰锛宧ttp://127.0.0.1:1818 鍜� http://localhost:1818 鏄笉涓�鏍风殑 + "IPs": "http://127.0.0.1:8080,http://localhost:8080,http://127.0.0.1:8081,http://localhost:8081" + }, + "ApiName": "WIDESEA", + "ExpMinutes": 120, + + // 闇�瑕佺Щ搴撶殑琛� + "TransfertRows": "1,4,5,8", + + // 鍏佽鍑哄簱鐨勭紪鐮� + "OutBoundMateriel": [ + { + "MaterielCode": "CC01050001348", + "ProductionLine": "ZJ-8", + "ProcessCode": "CH001" + } + ] +} diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/index.html" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/index.html" new file mode 100644 index 0000000..4a30502 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/index.html" @@ -0,0 +1,124 @@ +锘� +<!--1銆佺増鏈彿瑕佷笌nuget鍖呬竴鑷达紱2銆乮d涓嶈兘涓虹┖--> +<script async="async" id="mini-profiler" src="/profiler/includes.min.js?v=4.3.8+1120572909" data-version="4.3.8+1120572909" data-path="/profiler/" data-current-id="0d7e468e-0bb5-4c81-90fc-91fd1543640a" data-ids="0d7e468e-0bb5-4c81-90fc-91fd1543640a" data-position="Left" data-scheme="Light" data-authorized="true" data-children="true" data-max-traces="15" data-toggle-shortcut="Alt+P" data-trivial-milliseconds="2.0" data-ignored-duplicate-execute-types="Open,OpenAsync,Close,CloseAsync"></script> + +<!-- HTML for static distribution bundle build --> +<!DOCTYPE html> +<html lang="en"> +<head> + <meta charset="UTF-8"> + <!--鏋侀�熸ā寮�--> + <meta name="renderer" content="webkit" /> + <meta name="force-rendering" content="webkit" /> + <title>%(DocumentTitle)</title> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + <link rel="stylesheet" type="text/css" href="./swagger-ui.css"> + <link rel="icon" type="image/png" href="./logo/favicon-32x32.png" sizes="32x32" /> + <script src="js/jquery-3.3.1.min.js"></script> + <style> + + html { + box-sizing: border-box; + overflow-y: scroll; + } + + *, + *:before, + *:after { + box-sizing: inherit; + } + + body { + margin: 0; + background: #fafafa; + } + + .qqgroup { + position: absolute; + top: 67px; + right: 10px; + } + + .info { + float: left; + } + + .download-contents { + display: none; + } + </style> + %(HeadContent) +</head> +<body> + <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="position:absolute;width:0;height:0"> + <defs> + <symbol viewBox="0 0 20 20" id="unlocked"> + <path d="M15.8 8H14V5.6C14 2.703 12.665 1 10 1 7.334 1 6 2.703 6 5.6V6h2v-.801C8 3.754 8.797 3 10 3c1.203 0 2 .754 2 2.199V8H4c-.553 0-1 .646-1 1.199V17c0 .549.428 1.139.951 1.307l1.197.387C5.672 18.861 6.55 19 7.1 19h5.8c.549 0 1.428-.139 1.951-.307l1.196-.387c.524-.167.953-.757.953-1.306V9.199C17 8.646 16.352 8 15.8 8z"></path> + </symbol> + <symbol viewBox="0 0 20 20" id="locked"> + <path d="M15.8 8H14V5.6C14 2.703 12.665 1 10 1 7.334 1 6 2.703 6 5.6V8H4c-.553 0-1 .646-1 1.199V17c0 .549.428 1.139.951 1.307l1.197.387C5.672 18.861 6.55 19 7.1 19h5.8c.549 0 1.428-.139 1.951-.307l1.196-.387c.524-.167.953-.757.953-1.306V9.199C17 8.646 16.352 8 15.8 8zM12 8H8V5.199C8 3.754 8.797 3 10 3c1.203 0 2 .754 2 2.199V8z" /> + </symbol> + <symbol viewBox="0 0 20 20" id="close"> + <path d="M14.348 14.849c-.469.469-1.229.469-1.697 0L10 11.819l-2.651 3.029c-.469.469-1.229.469-1.697 0-.469-.469-.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-.469-.469-.469-1.228 0-1.697.469-.469 1.228-.469 1.697 0L10 8.183l2.651-3.031c.469-.469 1.228-.469 1.697 0 .469.469.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c.469.469.469 1.229 0 1.698z" /> + </symbol> + <symbol viewBox="0 0 20 20" id="large-arrow"> + <path d="M13.25 10L6.109 2.58c-.268-.27-.268-.707 0-.979.268-.27.701-.27.969 0l7.83 7.908c.268.271.268.709 0 .979l-7.83 7.908c-.268.271-.701.27-.969 0-.268-.269-.268-.707 0-.979L13.25 10z" /> + </symbol> + <symbol viewBox="0 0 20 20" id="large-arrow-down"> + <path d="M17.418 6.109c.272-.268.709-.268.979 0s.271.701 0 .969l-7.908 7.83c-.27.268-.707.268-.979 0l-7.908-7.83c-.27-.268-.27-.701 0-.969.271-.268.709-.268.979 0L10 13.25l7.418-7.141z" /> + </symbol> + + <symbol viewBox="0 0 24 24" id="jump-to"> + <path d="M19 7v4H5.83l3.58-3.59L8 6l-6 6 6 6 1.41-1.41L5.83 13H21V7z" /> + </symbol> + <symbol viewBox="0 0 24 24" id="expand"> + <path d="M10 18h4v-2h-4v2zM3 6v2h18V6H3zm3 7h12v-2H6v2z" /> + </symbol> + </defs> + </svg> + <div id="swagger-ui"></div> + <div id="footer" style="text-align: center;margin-bottom: 10px;"> + Copyright 漏 2024-2030 WIDESEA.Core + + <br><span id="poweredby">Powered by .NET 6.0.28</span> + </div> + <!-- Workaround for https://github.com/swagger-api/swagger-editor/issues/1371 --> + <script> + if (window.navigator.userAgent.indexOf("Edge") > -1) { + console.log("Removing native Edge fetch in favor of swagger-ui's polyfill") + window.fetch = undefined; + } + </script> + <script src="./swagger-ui-bundle.js"></script> + <script src="./swagger-ui-standalone-preset.js"></script> + <script> + var int = null; + window.onload = function () { + var configObject = JSON.parse('%(ConfigObject)'); + var oauthConfigObject = JSON.parse('%(OAuthConfigObject)'); + + // Apply mandatory parameters + configObject.dom_id = "#swagger-ui"; + configObject.presets = [SwaggerUIBundle.presets.apis, SwaggerUIStandalonePreset]; + configObject.layout = "StandaloneLayout"; + + // If oauth2RedirectUrl isn't specified, use the built-in default + if (!configObject.hasOwnProperty("oauth2RedirectUrl")) + configObject.oauth2RedirectUrl = window.location.href.replace("index.html", "oauth2-redirect.html"); + + // Build a system + const ui = SwaggerUIBundle(configObject); + + // Apply OAuth config + ui.initOAuth(oauthConfigObject); + + $(".link img").attr("src", "./logo/favicon-32x32.png"); + + $('#swagger-ui').after("<div class='qqgroup'><img src='https://img.neters.club/doc/wechatgongzhonghao.png' alt='QQ浜岀淮鐮�' style='width: 150px;'><div style=\"color: #4990e2;\"><a href=\"../allservices\" target=\"_blank\" rel=\"noopener noreferrer\" class=\"link\">1銆佹煡鐪嬫墍鏈変緷璧栨敞鍐岀殑鏈嶅姟</a><br><a href=\"../ui\" target=\"_blank\" rel=\"noopener noreferrer\" class=\"link\">2銆佹煡鐪嬪墠绔厤濂楅〉闈�</a></div></div><div style='clear: both;'></div>"); + + } + + + </script> +</body> +</html> diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/wwwroot/WIDESEA_DB.DBSeed.Json/Sys_Menu.tsv" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/wwwroot/WIDESEA_DB.DBSeed.Json/Sys_Menu.tsv" new file mode 100644 index 0000000..2efa8fb --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/wwwroot/WIDESEA_DB.DBSeed.Json/Sys_Menu.tsv" @@ -0,0 +1,146 @@ +[ + { + "MenuName": "鐢ㄦ埛绠$悊", + "Auth": "[{\"text\":\"鏌ヨ\",\"value\":\"Search\"}]", + "Icon": "el-icon-user", + "Description": null, + "Enable": 1, + "TableName": "/", + "ParentId": 0, + "Url": null, + "OrderNo": 4000, + "MenuType": 99, + "Creater": "admin", + "CreateDate": null, + "Modifier": null, + "ModifyDate": null + }, + { + "MenuName": "鐢ㄦ埛绠$悊", + "Auth": "[{\"text\":\"鏌ヨ\",\"value\":\"Search\"},{\"text\":\"鏂板缓\",\"value\":\"Add\"},{\"text\":\"鍒犻櫎\",\"value\":\"Delete\"},{\"text\":\"缂栬緫\",\"value\":\"Update\"},{\"text\":\"瀵煎嚭\",\"value\":\"Export\"}]", + "Icon": null, + "Description": null, + "Enable": 1, + "TableName": "Sys_User", + "ParentId": 1, + "Url": "/Sys_User", + "OrderNo": 2000, + "MenuType": 99, + "Creater": "admin", + "CreateDate": null, + "Modifier": null, + "ModifyDate": null + }, + { + "MenuName": "鏉冮檺绠$悊", + "Auth": "[{\"text\":\"鏌ヨ\",\"value\":\"Search\"},{\"text\":\"缂栬緫\",\"value\":\"Update\"}]", + "Icon": "ivu-icon ivu-icon-ios-boat", + "Description": null, + "Enable": 1, + "TableName": "/", + "ParentId": 1, + "Url": "/permission", + "OrderNo": 1000, + "MenuType": 99, + "Creater": "admin", + "CreateDate": null, + "Modifier": null, + "ModifyDate": null + }, + { + "MenuName": "瑙掕壊绠$悊", + "Auth": "[{\"text\":\"鏌ヨ\",\"value\":\"Search\"},{\"text\":\"鏂板缓\",\"value\":\"Add\"},{\"text\":\"鍒犻櫎\",\"value\":\"Delete\"},{\"text\":\"缂栬緫\",\"value\":\"Update\"},{\"text\":\"瀵煎嚭\",\"value\":\"Export\"}]", + "Icon": null, + "Description": null, + "Enable": 1, + "TableName": "Sys_Role", + "ParentId": 1, + "Url": "/Sys_Role", + "OrderNo": 900, + "MenuType": 99, + "Creater": "admin", + "CreateDate": null, + "Modifier": null, + "ModifyDate": null + }, + { + "MenuName": "绯荤粺璁剧疆", + "Auth": "[{\"text\":\"鏌ヨ\",\"value\":\"Search\"}]", + "Icon": "el-icon-setting", + "Description": null, + "Enable": 1, + "TableName": "/", + "ParentId": 0, + "Url": "/", + "OrderNo": 0, + "MenuType": 99, + "Creater": "admin", + "CreateDate": null, + "Modifier": null, + "ModifyDate": null + }, + { + "MenuName": "鑿滃崟璁剧疆", + "Auth": "[{\"text\":\"鏌ヨ\",\"value\":\"Search\"},{\"text\":\"瀵煎嚭\",\"value\":\"Export\"}]", + "Icon": null, + "Description": null, + "Enable": 1, + "TableName": "Sys_Menu", + "ParentId": 5, + "Url": "/sysmenu", + "OrderNo": 10, + "MenuType": 99, + "Creater": "admin", + "CreateDate": null, + "Modifier": null, + "ModifyDate": null + }, + { + "MenuName": "涓嬫媺妗嗙粦瀹氳缃�", + "Auth": "[{\"text\":\"鏌ヨ\",\"value\":\"Search\"},{\"text\":\"鏂板缓\",\"value\":\"Add\"},{\"text\":\"鍒犻櫎\",\"value\":\"Delete\"},{\"text\":\"缂栬緫\",\"value\":\"Update\"},{\"text\":\"瀵煎叆\",\"value\":\"Import\"},{\"text\":\"瀵煎嚭\",\"value\":\"Export\"}]", + "Icon": null, + "Description": null, + "Enable": 1, + "TableName": "Sys_Dictionary", + "ParentId": 5, + "Url": "/Sys_Dictionary", + "OrderNo": 10, + "MenuType": 99, + "Creater": "admin", + "CreateDate": null, + "Modifier": null, + "ModifyDate": null + }, + { + "MenuName": "鏃ュ織绠$悊", + "Auth": "[{\"text\":\"鏌ヨ\",\"value\":\"Search\"}]", + "Icon": "el-icon-date", + "Description": null, + "Enable": 1, + "TableName": "/", + "ParentId": 0, + "Url": "/", + "OrderNo": 500, + "MenuType": 99, + "Creater": "admin", + "CreateDate": null, + "Modifier": null, + "ModifyDate": null + }, + { + "MenuName": "鎺ュ彛鏃ュ織", + "Auth": "[{\"text\":\"鏌ヨ\",\"value\":\"Search\"},{\"text\":\"鍒犻櫎\",\"value\":\"Delete\"},{\"text\":\"瀵煎嚭\",\"value\":\"Export\"}]", + "Icon": null, + "Description": null, + "Enable": 1, + "TableName": "Sys_Log", + "ParentId": 8, + "Url": "/Sys_Log/Manager", + "OrderNo": 0, + "MenuType": 99, + "Creater": "admin", + "CreateDate": null, + "Modifier": null, + "ModifyDate": null + } +] \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/wwwroot/WIDESEA_DB.DBSeed.Json/Sys_Tenant.tsv" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/wwwroot/WIDESEA_DB.DBSeed.Json/Sys_Tenant.tsv" new file mode 100644 index 0000000..84c3e59 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/wwwroot/WIDESEA_DB.DBSeed.Json/Sys_Tenant.tsv" @@ -0,0 +1,3 @@ +[ + +] \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/wwwroot/WIDESEA_DB.DBSeed.Json/Sys_User.tsv" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/wwwroot/WIDESEA_DB.DBSeed.Json/Sys_User.tsv" new file mode 100644 index 0000000..1fda989 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/wwwroot/WIDESEA_DB.DBSeed.Json/Sys_User.tsv" @@ -0,0 +1,26 @@ +[ + { + "UserName": "admin", + "Role_Id": "1", + "RoleName": "瓒呯骇绠$悊鍛�", + "PhoneNo": "", + "Remark": "", + "UserPwd": "j79rYYvCz4vdhcboB1Ausg==", + "UserTrueName": "瓒呯骇绠$悊鍛�", + "DeptName": "", + "Dept_Id": "0", + "Email": "", + "Enable": "1", + "Gender": "1", + "HeadImageUrl": "", + "LastModifyPwdDate": "2024-04-16 19:58:55", + "Address": "绯荤粺鏈嶅姟鍣�", + "AuditDate": "2024-04-16 00:54:06", + "AuditStatus": "1", + "Auditor": "瓒呯骇绠$悊鍛�", + "Token": "", + "SystemType": "1", + "Creater": "绯荤粺", + "TenantId": 0 + } +] \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/wwwroot/css/style.css" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/wwwroot/css/style.css" new file mode 100644 index 0000000..f8fe18d --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/wwwroot/css/style.css" @@ -0,0 +1,132 @@ +@charset "utf-8"; +::selection { + background: #2D2F36; +} +::-webkit-selection { + background: #2D2F36; +} +::-moz-selection { + background: #2D2F36; +} +body { + background: white; + font-family: 'Inter UI', sans-serif; + margin: 0; + padding: 20px; +} +.page { + background: #e2e2e5; + display: flex; + flex-direction: column; + height: calc(100% - 40px); + position: absolute; + place-content: center; + width: calc(100% - 40px); +} +@media (max-width: 767px) { + .page { + height: auto; + margin-bottom: 20px; + padding-bottom: 20px; + } +} +.container { + display: flex; + height: 320px; + margin: 0 auto; + width: 640px; +} +@media (max-width: 767px) { + .container { + flex-direction: column; + height: 630px; + width: 320px; + } +} +.left { + background: white; + height: calc(100% - 40px); + top: 20px; + position: relative; + width: 50%; +} +@media (max-width: 767px) { + .left { + height: 100%; + left: 20px; + width: calc(100% - 40px); + max-height: 270px; + } +} +.login { + font-size: 33px; + font-weight: 900; + margin: 50px 40px 40px; +} +.eula { + color: #999; + font-size: 14px; + line-height: 1.5; + margin: 40px; +} +.right { + background: #474A59; + box-shadow: 0px 0px 40px 16px rgba(0,0,0,0.22); + color: #F1F1F2; + position: relative; + width: 50%; +} +@media (max-width: 767px) { + .right { + flex-shrink: 0; + height: 100%; + width: 100%; + max-height: 350px; + } +} +svg { + position: absolute; + width: 320px; +} +path { + fill: none; + stroke: url(#linearGradient);; + stroke-width: 4; + stroke-dasharray: 240 1386; +} +.form { + margin: 40px; + position: absolute; +} +label { + color: #c2c2c5; + display: block; + font-size: 14px; + height: 16px; + margin-top: 20px; + margin-bottom: 5px; +} +input { + background: transparent; + border: 0; + color: #f2f2f2; + font-size: 20px; + height: 30px; + line-height: 30px; + outline: none !important; + width: 100%; +} +input::-moz-focus-inner { + border: 0; +} +#submit { + color: #707075; + margin-top: 40px; + transition: color 300ms; +} +#submit:focus { + color: #f2f2f2; +} +#submit:active { + color: #d0d0d2; +} \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/wwwroot/js/anime.min.js" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/wwwroot/js/anime.min.js" new file mode 100644 index 0000000..c399324 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/wwwroot/js/anime.min.js" @@ -0,0 +1,33 @@ +/* + 2017 Julian Garnier + Released under the MIT license +*/ +var $jscomp={scope:{}};$jscomp.defineProperty="function"==typeof Object.defineProperties?Object.defineProperty:function(e,r,p){if(p.get||p.set)throw new TypeError("ES3 does not support getters and setters.");e!=Array.prototype&&e!=Object.prototype&&(e[r]=p.value)};$jscomp.getGlobal=function(e){return"undefined"!=typeof window&&window===e?e:"undefined"!=typeof global&&null!=global?global:e};$jscomp.global=$jscomp.getGlobal(this);$jscomp.SYMBOL_PREFIX="jscomp_symbol_"; +$jscomp.initSymbol=function(){$jscomp.initSymbol=function(){};$jscomp.global.Symbol||($jscomp.global.Symbol=$jscomp.Symbol)};$jscomp.symbolCounter_=0;$jscomp.Symbol=function(e){return $jscomp.SYMBOL_PREFIX+(e||"")+$jscomp.symbolCounter_++}; +$jscomp.initSymbolIterator=function(){$jscomp.initSymbol();var e=$jscomp.global.Symbol.iterator;e||(e=$jscomp.global.Symbol.iterator=$jscomp.global.Symbol("iterator"));"function"!=typeof Array.prototype[e]&&$jscomp.defineProperty(Array.prototype,e,{configurable:!0,writable:!0,value:function(){return $jscomp.arrayIterator(this)}});$jscomp.initSymbolIterator=function(){}};$jscomp.arrayIterator=function(e){var r=0;return $jscomp.iteratorPrototype(function(){return r<e.length?{done:!1,value:e[r++]}:{done:!0}})}; +$jscomp.iteratorPrototype=function(e){$jscomp.initSymbolIterator();e={next:e};e[$jscomp.global.Symbol.iterator]=function(){return this};return e};$jscomp.array=$jscomp.array||{};$jscomp.iteratorFromArray=function(e,r){$jscomp.initSymbolIterator();e instanceof String&&(e+="");var p=0,m={next:function(){if(p<e.length){var u=p++;return{value:r(u,e[u]),done:!1}}m.next=function(){return{done:!0,value:void 0}};return m.next()}};m[Symbol.iterator]=function(){return m};return m}; +$jscomp.polyfill=function(e,r,p,m){if(r){p=$jscomp.global;e=e.split(".");for(m=0;m<e.length-1;m++){var u=e[m];u in p||(p[u]={});p=p[u]}e=e[e.length-1];m=p[e];r=r(m);r!=m&&null!=r&&$jscomp.defineProperty(p,e,{configurable:!0,writable:!0,value:r})}};$jscomp.polyfill("Array.prototype.keys",function(e){return e?e:function(){return $jscomp.iteratorFromArray(this,function(e){return e})}},"es6-impl","es3");var $jscomp$this=this; +(function(e,r){"function"===typeof define&&define.amd?define([],r):"object"===typeof module&&module.exports?module.exports=r():e.anime=r()})(this,function(){function e(a){if(!h.col(a))try{return document.querySelectorAll(a)}catch(c){}}function r(a,c){for(var d=a.length,b=2<=arguments.length?arguments[1]:void 0,f=[],n=0;n<d;n++)if(n in a){var k=a[n];c.call(b,k,n,a)&&f.push(k)}return f}function p(a){return a.reduce(function(a,d){return a.concat(h.arr(d)?p(d):d)},[])}function m(a){if(h.arr(a))return a; +h.str(a)&&(a=e(a)||a);return a instanceof NodeList||a instanceof HTMLCollection?[].slice.call(a):[a]}function u(a,c){return a.some(function(a){return a===c})}function C(a){var c={},d;for(d in a)c[d]=a[d];return c}function D(a,c){var d=C(a),b;for(b in a)d[b]=c.hasOwnProperty(b)?c[b]:a[b];return d}function z(a,c){var d=C(a),b;for(b in c)d[b]=h.und(a[b])?c[b]:a[b];return d}function T(a){a=a.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,function(a,c,d,k){return c+c+d+d+k+k});var c=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(a); +a=parseInt(c[1],16);var d=parseInt(c[2],16),c=parseInt(c[3],16);return"rgba("+a+","+d+","+c+",1)"}function U(a){function c(a,c,b){0>b&&(b+=1);1<b&&--b;return b<1/6?a+6*(c-a)*b:.5>b?c:b<2/3?a+(c-a)*(2/3-b)*6:a}var d=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(a)||/hsla\((\d+),\s*([\d.]+)%,\s*([\d.]+)%,\s*([\d.]+)\)/g.exec(a);a=parseInt(d[1])/360;var b=parseInt(d[2])/100,f=parseInt(d[3])/100,d=d[4]||1;if(0==b)f=b=a=f;else{var n=.5>f?f*(1+b):f+b-f*b,k=2*f-n,f=c(k,n,a+1/3),b=c(k,n,a);a=c(k,n,a-1/3)}return"rgba("+ +255*f+","+255*b+","+255*a+","+d+")"}function y(a){if(a=/([\+\-]?[0-9#\.]+)(%|px|pt|em|rem|in|cm|mm|ex|ch|pc|vw|vh|vmin|vmax|deg|rad|turn)?$/.exec(a))return a[2]}function V(a){if(-1<a.indexOf("translate")||"perspective"===a)return"px";if(-1<a.indexOf("rotate")||-1<a.indexOf("skew"))return"deg"}function I(a,c){return h.fnc(a)?a(c.target,c.id,c.total):a}function E(a,c){if(c in a.style)return getComputedStyle(a).getPropertyValue(c.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase())||"0"}function J(a,c){if(h.dom(a)&& +u(W,c))return"transform";if(h.dom(a)&&(a.getAttribute(c)||h.svg(a)&&a[c]))return"attribute";if(h.dom(a)&&"transform"!==c&&E(a,c))return"css";if(null!=a[c])return"object"}function X(a,c){var d=V(c),d=-1<c.indexOf("scale")?1:0+d;a=a.style.transform;if(!a)return d;for(var b=[],f=[],n=[],k=/(\w+)\((.+?)\)/g;b=k.exec(a);)f.push(b[1]),n.push(b[2]);a=r(n,function(a,b){return f[b]===c});return a.length?a[0]:d}function K(a,c){switch(J(a,c)){case "transform":return X(a,c);case "css":return E(a,c);case "attribute":return a.getAttribute(c)}return a[c]|| +0}function L(a,c){var d=/^(\*=|\+=|-=)/.exec(a);if(!d)return a;var b=y(a)||0;c=parseFloat(c);a=parseFloat(a.replace(d[0],""));switch(d[0][0]){case "+":return c+a+b;case "-":return c-a+b;case "*":return c*a+b}}function F(a,c){return Math.sqrt(Math.pow(c.x-a.x,2)+Math.pow(c.y-a.y,2))}function M(a){a=a.points;for(var c=0,d,b=0;b<a.numberOfItems;b++){var f=a.getItem(b);0<b&&(c+=F(d,f));d=f}return c}function N(a){if(a.getTotalLength)return a.getTotalLength();switch(a.tagName.toLowerCase()){case "circle":return 2* +Math.PI*a.getAttribute("r");case "rect":return 2*a.getAttribute("width")+2*a.getAttribute("height");case "line":return F({x:a.getAttribute("x1"),y:a.getAttribute("y1")},{x:a.getAttribute("x2"),y:a.getAttribute("y2")});case "polyline":return M(a);case "polygon":var c=a.points;return M(a)+F(c.getItem(c.numberOfItems-1),c.getItem(0))}}function Y(a,c){function d(b){b=void 0===b?0:b;return a.el.getPointAtLength(1<=c+b?c+b:0)}var b=d(),f=d(-1),n=d(1);switch(a.property){case "x":return b.x;case "y":return b.y; +case "angle":return 180*Math.atan2(n.y-f.y,n.x-f.x)/Math.PI}}function O(a,c){var d=/-?\d*\.?\d+/g,b;b=h.pth(a)?a.totalLength:a;if(h.col(b))if(h.rgb(b)){var f=/rgb\((\d+,\s*[\d]+,\s*[\d]+)\)/g.exec(b);b=f?"rgba("+f[1]+",1)":b}else b=h.hex(b)?T(b):h.hsl(b)?U(b):void 0;else f=(f=y(b))?b.substr(0,b.length-f.length):b,b=c&&!/\s/g.test(b)?f+c:f;b+="";return{original:b,numbers:b.match(d)?b.match(d).map(Number):[0],strings:h.str(a)||c?b.split(d):[]}}function P(a){a=a?p(h.arr(a)?a.map(m):m(a)):[];return r(a, +function(a,d,b){return b.indexOf(a)===d})}function Z(a){var c=P(a);return c.map(function(a,b){return{target:a,id:b,total:c.length}})}function aa(a,c){var d=C(c);if(h.arr(a)){var b=a.length;2!==b||h.obj(a[0])?h.fnc(c.duration)||(d.duration=c.duration/b):a={value:a}}return m(a).map(function(a,b){b=b?0:c.delay;a=h.obj(a)&&!h.pth(a)?a:{value:a};h.und(a.delay)&&(a.delay=b);return a}).map(function(a){return z(a,d)})}function ba(a,c){var d={},b;for(b in a){var f=I(a[b],c);h.arr(f)&&(f=f.map(function(a){return I(a, +c)}),1===f.length&&(f=f[0]));d[b]=f}d.duration=parseFloat(d.duration);d.delay=parseFloat(d.delay);return d}function ca(a){return h.arr(a)?A.apply(this,a):Q[a]}function da(a,c){var d;return a.tweens.map(function(b){b=ba(b,c);var f=b.value,e=K(c.target,a.name),k=d?d.to.original:e,k=h.arr(f)?f[0]:k,w=L(h.arr(f)?f[1]:f,k),e=y(w)||y(k)||y(e);b.from=O(k,e);b.to=O(w,e);b.start=d?d.end:a.offset;b.end=b.start+b.delay+b.duration;b.easing=ca(b.easing);b.elasticity=(1E3-Math.min(Math.max(b.elasticity,1),999))/ +1E3;b.isPath=h.pth(f);b.isColor=h.col(b.from.original);b.isColor&&(b.round=1);return d=b})}function ea(a,c){return r(p(a.map(function(a){return c.map(function(b){var c=J(a.target,b.name);if(c){var d=da(b,a);b={type:c,property:b.name,animatable:a,tweens:d,duration:d[d.length-1].end,delay:d[0].delay}}else b=void 0;return b})})),function(a){return!h.und(a)})}function R(a,c,d,b){var f="delay"===a;return c.length?(f?Math.min:Math.max).apply(Math,c.map(function(b){return b[a]})):f?b.delay:d.offset+b.delay+ +b.duration}function fa(a){var c=D(ga,a),d=D(S,a),b=Z(a.targets),f=[],e=z(c,d),k;for(k in a)e.hasOwnProperty(k)||"targets"===k||f.push({name:k,offset:e.offset,tweens:aa(a[k],d)});a=ea(b,f);return z(c,{children:[],animatables:b,animations:a,duration:R("duration",a,c,d),delay:R("delay",a,c,d)})}function q(a){function c(){return window.Promise&&new Promise(function(a){return p=a})}function d(a){return g.reversed?g.duration-a:a}function b(a){for(var b=0,c={},d=g.animations,f=d.length;b<f;){var e=d[b], +k=e.animatable,h=e.tweens,n=h.length-1,l=h[n];n&&(l=r(h,function(b){return a<b.end})[0]||l);for(var h=Math.min(Math.max(a-l.start-l.delay,0),l.duration)/l.duration,w=isNaN(h)?1:l.easing(h,l.elasticity),h=l.to.strings,p=l.round,n=[],m=void 0,m=l.to.numbers.length,t=0;t<m;t++){var x=void 0,x=l.to.numbers[t],q=l.from.numbers[t],x=l.isPath?Y(l.value,w*x):q+w*(x-q);p&&(l.isColor&&2<t||(x=Math.round(x*p)/p));n.push(x)}if(l=h.length)for(m=h[0],w=0;w<l;w++)p=h[w+1],t=n[w],isNaN(t)||(m=p?m+(t+p):m+(t+" ")); +else m=n[0];ha[e.type](k.target,e.property,m,c,k.id);e.currentValue=m;b++}if(b=Object.keys(c).length)for(d=0;d<b;d++)H||(H=E(document.body,"transform")?"transform":"-webkit-transform"),g.animatables[d].target.style[H]=c[d].join(" ");g.currentTime=a;g.progress=a/g.duration*100}function f(a){if(g[a])g[a](g)}function e(){g.remaining&&!0!==g.remaining&&g.remaining--}function k(a){var k=g.duration,n=g.offset,w=n+g.delay,r=g.currentTime,x=g.reversed,q=d(a);if(g.children.length){var u=g.children,v=u.length; +if(q>=g.currentTime)for(var G=0;G<v;G++)u[G].seek(q);else for(;v--;)u[v].seek(q)}if(q>=w||!k)g.began||(g.began=!0,f("begin")),f("run");if(q>n&&q<k)b(q);else if(q<=n&&0!==r&&(b(0),x&&e()),q>=k&&r!==k||!k)b(k),x||e();f("update");a>=k&&(g.remaining?(t=h,"alternate"===g.direction&&(g.reversed=!g.reversed)):(g.pause(),g.completed||(g.completed=!0,f("complete"),"Promise"in window&&(p(),m=c()))),l=0)}a=void 0===a?{}:a;var h,t,l=0,p=null,m=c(),g=fa(a);g.reset=function(){var a=g.direction,c=g.loop;g.currentTime= +0;g.progress=0;g.paused=!0;g.began=!1;g.completed=!1;g.reversed="reverse"===a;g.remaining="alternate"===a&&1===c?2:c;b(0);for(a=g.children.length;a--;)g.children[a].reset()};g.tick=function(a){h=a;t||(t=h);k((l+h-t)*q.speed)};g.seek=function(a){k(d(a))};g.pause=function(){var a=v.indexOf(g);-1<a&&v.splice(a,1);g.paused=!0};g.play=function(){g.paused&&(g.paused=!1,t=0,l=d(g.currentTime),v.push(g),B||ia())};g.reverse=function(){g.reversed=!g.reversed;t=0;l=d(g.currentTime)};g.restart=function(){g.pause(); +g.reset();g.play()};g.finished=m;g.reset();g.autoplay&&g.play();return g}var ga={update:void 0,begin:void 0,run:void 0,complete:void 0,loop:1,direction:"normal",autoplay:!0,offset:0},S={duration:1E3,delay:0,easing:"easeOutElastic",elasticity:500,round:0},W="translateX translateY translateZ rotate rotateX rotateY rotateZ scale scaleX scaleY scaleZ skewX skewY perspective".split(" "),H,h={arr:function(a){return Array.isArray(a)},obj:function(a){return-1<Object.prototype.toString.call(a).indexOf("Object")}, +pth:function(a){return h.obj(a)&&a.hasOwnProperty("totalLength")},svg:function(a){return a instanceof SVGElement},dom:function(a){return a.nodeType||h.svg(a)},str:function(a){return"string"===typeof a},fnc:function(a){return"function"===typeof a},und:function(a){return"undefined"===typeof a},hex:function(a){return/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(a)},rgb:function(a){return/^rgb/.test(a)},hsl:function(a){return/^hsl/.test(a)},col:function(a){return h.hex(a)||h.rgb(a)||h.hsl(a)}},A=function(){function a(a, +d,b){return(((1-3*b+3*d)*a+(3*b-6*d))*a+3*d)*a}return function(c,d,b,f){if(0<=c&&1>=c&&0<=b&&1>=b){var e=new Float32Array(11);if(c!==d||b!==f)for(var k=0;11>k;++k)e[k]=a(.1*k,c,b);return function(k){if(c===d&&b===f)return k;if(0===k)return 0;if(1===k)return 1;for(var h=0,l=1;10!==l&&e[l]<=k;++l)h+=.1;--l;var l=h+(k-e[l])/(e[l+1]-e[l])*.1,n=3*(1-3*b+3*c)*l*l+2*(3*b-6*c)*l+3*c;if(.001<=n){for(h=0;4>h;++h){n=3*(1-3*b+3*c)*l*l+2*(3*b-6*c)*l+3*c;if(0===n)break;var m=a(l,c,b)-k,l=l-m/n}k=l}else if(0=== +n)k=l;else{var l=h,h=h+.1,g=0;do m=l+(h-l)/2,n=a(m,c,b)-k,0<n?h=m:l=m;while(1e-7<Math.abs(n)&&10>++g);k=m}return a(k,d,f)}}}}(),Q=function(){function a(a,b){return 0===a||1===a?a:-Math.pow(2,10*(a-1))*Math.sin(2*(a-1-b/(2*Math.PI)*Math.asin(1))*Math.PI/b)}var c="Quad Cubic Quart Quint Sine Expo Circ Back Elastic".split(" "),d={In:[[.55,.085,.68,.53],[.55,.055,.675,.19],[.895,.03,.685,.22],[.755,.05,.855,.06],[.47,0,.745,.715],[.95,.05,.795,.035],[.6,.04,.98,.335],[.6,-.28,.735,.045],a],Out:[[.25, +.46,.45,.94],[.215,.61,.355,1],[.165,.84,.44,1],[.23,1,.32,1],[.39,.575,.565,1],[.19,1,.22,1],[.075,.82,.165,1],[.175,.885,.32,1.275],function(b,c){return 1-a(1-b,c)}],InOut:[[.455,.03,.515,.955],[.645,.045,.355,1],[.77,0,.175,1],[.86,0,.07,1],[.445,.05,.55,.95],[1,0,0,1],[.785,.135,.15,.86],[.68,-.55,.265,1.55],function(b,c){return.5>b?a(2*b,c)/2:1-a(-2*b+2,c)/2}]},b={linear:A(.25,.25,.75,.75)},f={},e;for(e in d)f.type=e,d[f.type].forEach(function(a){return function(d,f){b["ease"+a.type+c[f]]=h.fnc(d)? +d:A.apply($jscomp$this,d)}}(f)),f={type:f.type};return b}(),ha={css:function(a,c,d){return a.style[c]=d},attribute:function(a,c,d){return a.setAttribute(c,d)},object:function(a,c,d){return a[c]=d},transform:function(a,c,d,b,f){b[f]||(b[f]=[]);b[f].push(c+"("+d+")")}},v=[],B=0,ia=function(){function a(){B=requestAnimationFrame(c)}function c(c){var b=v.length;if(b){for(var d=0;d<b;)v[d]&&v[d].tick(c),d++;a()}else cancelAnimationFrame(B),B=0}return a}();q.version="2.2.0";q.speed=1;q.running=v;q.remove= +function(a){a=P(a);for(var c=v.length;c--;)for(var d=v[c],b=d.animations,f=b.length;f--;)u(a,b[f].animatable.target)&&(b.splice(f,1),b.length||d.pause())};q.getValue=K;q.path=function(a,c){var d=h.str(a)?e(a)[0]:a,b=c||100;return function(a){return{el:d,property:a,totalLength:N(d)*(b/100)}}};q.setDashoffset=function(a){var c=N(a);a.setAttribute("stroke-dasharray",c);return c};q.bezier=A;q.easings=Q;q.timeline=function(a){var c=q(a);c.pause();c.duration=0;c.add=function(d){c.children.forEach(function(a){a.began= +!0;a.completed=!0});m(d).forEach(function(b){var d=z(b,D(S,a||{}));d.targets=d.targets||a.targets;b=c.duration;var e=d.offset;d.autoplay=!1;d.direction=c.direction;d.offset=h.und(e)?b:L(e,b);c.began=!0;c.completed=!0;c.seek(d.offset);d=q(d);d.began=!0;d.completed=!0;d.duration>b&&(c.duration=d.duration);c.children.push(d)});c.seek(0);c.reset();c.autoplay&&c.restart();return c};return c};q.random=function(a,c){return Math.floor(Math.random()*(c-a+1))+a};return q}); \ No newline at end of file diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/wwwroot/swg-login.html" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/wwwroot/swg-login.html" new file mode 100644 index 0000000..f1340e9 --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/wwwroot/swg-login.html" @@ -0,0 +1,130 @@ +锘�<!DOCTYPE html> +<html> +<head> + <meta charset="utf-8" /> + <title>鐧诲綍 - 鎺ュ彛鏂囨。</title> + <!--<script src="http://code.jquery.com/jquery-1.8.3.min.js"></script>--> + <script src="js/jquery-1.8.3.min.js"></script> + <link type="text/css" href="css/style.css" rel="stylesheet" /> + <script src="js/anime.min.js"></script> + +</head> +<body> + <div class="page"> + <div class="container"> + <div class="left"> + <div></div> + + <div class="login"><img src="/logo.jpg.jpg" height="30" alt="Alternate Text" /> 鎺ュ彛鏂囨。</div> + <div class="eula">娆㈣繋浣跨敤锛�</div> + <!--<div class="eula">鐢ㄦ埛鍚嶏細admin锛屽瘑鐮侊細admin</div>--> + </div> + <div class="right"> + <svg viewBox="0 0 320 300"> + <defs> + <linearGradient inkscape:collect="always" + id="linearGradient" + x1="13" + y1="193.49992" + x2="307" + y2="193.49992" + gradientUnits="userSpaceOnUse"> + <stop style="stop-color:#ff00ff;" + offset="0" + id="stop876" /> + <stop style="stop-color:#ff0000;" + offset="1" + id="stop878" /> + </linearGradient> + </defs> + <path d="m 40,120.00016 239.99984,-3.2e-4 c 0,0 24.99263,0.79932 25.00016,35.00016 0.008,34.20084 -25.00016,35 -25.00016,35 h -239.99984 c 0,-0.0205 -25,4.01348 -25,38.5 0,34.48652 25,38.5 25,38.5 h 215 c 0,0 20,-0.99604 20,-25 0,-24.00396 -20,-25 -20,-25 h -190 c 0,0 -20,1.71033 -20,25 0,24.00396 20,25 20,25 h 168.57143" /> + </svg> + <div class="form"> + <label for="email">鐢ㄦ埛鍚�</label> + <input type="email" id="email"> + <label for="password">瀵嗙爜</label> + <input type="password" id="password"> + <input type="submit" id="submit" onclick="submit()" value="鐧� 褰�"> + </div> + </div> + </div> + </div> + + <script> + var current = null; + document.querySelector('#email').addEventListener('focus', function (e) { + if (current) current.pause(); + current = anime({ + targets: 'path', + strokeDashoffset: { + value: 0, + duration: 700, + easing: 'easeOutQuart' + }, + strokeDasharray: { + value: '240 1386', + duration: 700, + easing: 'easeOutQuart' + } + }); + }); + document.querySelector('#password').addEventListener('focus', function (e) { + if (current) current.pause(); + current = anime({ + targets: 'path', + strokeDashoffset: { + value: -336, + duration: 700, + easing: 'easeOutQuart' + }, + strokeDasharray: { + value: '240 1386', + duration: 700, + easing: 'easeOutQuart' + } + }); + }); + document.querySelector('#submit').addEventListener('focus', function (e) { + if (current) current.pause(); + current = anime({ + targets: 'path', + strokeDashoffset: { + value: -730, + duration: 700, + easing: 'easeOutQuart' + }, + strokeDasharray: { + value: '530 1386', + duration: 700, + easing: 'easeOutQuart' + } + }); + }); + function submit() { + let postdata = { + "name": $("#email").val(), + "pwd": $("#password").val(), + }; + if (!(postdata.name && postdata.pwd)) { + alert('鍙傛暟涓嶆纭�'); + return + } + $.ajax({ + url: "/api/User/swgLogin", + type: "POST", + contentType: "application/json; charset=utf-8", + data: JSON.stringify(postdata), + dataType: 'json', + success: function (data) { + if (data?.result) { + window.location.href = "/index.html"; + } else { + alert('鍙傛暟涓嶆纭�'); + } + } + }); + } + </script> + +</body> +</html> \ No newline at end of file -- Gitblit v1.9.3